Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My Drive
- Today
- 12:03 PM
- J
- You uploaded an item
- Java
- Assignment5dot2.java
- Last week
- Fri 11:25 AM
- J
- You uploaded 5 items
- Java
- CollegeStudent.java
- Java
- Exponent.java
- Java
- Registrar.java
- Java
- Lottery.java
- Java
- CreatePurchase.java
- Fri 11:25 AM
- J
- You created an item in
- Google Drive Folder
- Bellevue University
- Google Drive Folder
- Java Code
- Last month
- Jan 15
- J
- You edited an item
- Word
- Group 5 - Resource Allocatoin - Week 7.docx
- Jan 14
- J
- You created and shared an item in
- Google Drive Folder
- Information Technology Project
- Word
- Group 5 - Risk Register - Week 9.docx
- Can edit
- Anyone with the link
- Jan 14
- J
- Youmoved an item to the trash
- Word
- Group 5 - Risk Register - Week 9.docx
- Jan 14
- J
- You created 2 items in
- Google Drive Folder
- Information Technology Project
- Word
- Group 5 - Risk Register - Week 9.docx
- Word
- Group 5 - Probability/Impact Matrix - Week 9.docx
- Jan 10
- J
- You uploaded an item
- PDF
- Benchmark Progress Report - Jason Staley_Jan2020.pdf
- Jan 9
- J
- You edited an item
- Word
- Group 5 - Project Communication Plan - Week 8.docx
- Jan 8
- J
- You created and shared an item in
- Google Drive Folder
- Information Technology Project
- Word
- Group 5 - Project Communication Plan - Week 8.docx
- Can edit
- Anyone with the link
- Last year
- Dec 20, 2019
- J
- You edited an item
- Word
- Group 5 - Resource Allocatoin - Week 7.docx
- Dec 19, 2019
- J
- You created and shared 2 items in
- Google Drive Folder
- Information Technology Project
- Word
- Group 5 - Resource Allocatoin - Week 7.docx
- Word
- Group 5 - Cost Estimate - Week 7.docx
- Can edit
- Anyone with the link
- Dec 19, 2019
- J
- You edited an item
- Word
- Group 5 - Cost Estimate - Week 7.docx
- Dec 3, 2019
- J
- Youmoved 4 items to the trash
- XML
- sms.xsl
- XML
- calls.xsl
- Text
- BackupRestoreTest.txt
- XML
- calls-20191202184506.xml
- Dec 2, 2019
- J
- You uploaded 5 items
- XML
- sms.xsl
- XML
- sms-20191202184506.xml
- XML
- calls.xsl
- XML
- calls-20191202184506.xml
- Text
- BackupRestoreTest.txt
- Dec 2, 2019
- J
- You created an item in
- My Drive
- Google Drive Folder
- Text messages
- Dec 2, 2019
- J
- You moved an item to
- Google Drive Folder
- 2018
- PDF
- 2018 Supporting Documents for Tax Returns.pdf
- Dec 2, 2019
- J
- You created an item in
- My Drive
- PDF
- 2018 Supporting Documents for Tax Returns.pdf
- Dec 2, 2019
- J
- You moved an item to
- Google Drive Folder
- 2018
- PDF
- 2018 Corporate Return.pdf
- Dec 2, 2019
- J
- You created an item in
- My Drive
- PDF
- 2018 Corporate Return.pdf
- /*
- Jason Staley
- 2/24/2020
- Assignment 5.2
- Simple debug for Week 5
- Bellevue University
- File Name: Assignment5dot2.java
- Number of bugs: 3
- */
- import java.utility.*;
- public class Assignment5dot2 {
- public static void main(String[] args) {
- //Create Scanner object to get user input
- Scanner keyboard = new Scanner(System.in);
- //Prompt user for total of numbers
- System.out.print("\nPlease enter how many generated random numbers (numbers range from 0 to 99) you want to have sorted >> ");
- int userNum = keyboard.nextInt();
- //Create array for random numbers
- int[] randomNums = new int[userNum];
- //Fill array with random numbers
- for (int x = 0; x < randomNums.length; ++x)
- randomNums[x] = (int)(Math.rand() * 100);
- //Display numbers
- System.out.println("\nRandom numbers generated >> ");
- for(int val : randomNums)
- System.out.print(val + " ");
- //Display numbers sorted
- System.out.println("\n\nRandom numbers sorted >> ");
- Arrays.sort(randomNums);
- for(int val : randomNums)
- System.out.print(val + " ");
- //Extra blank line for spacing
- System.out.println(");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement