Question
1. Define a two-dimension array with 10 rows and 2 columns. 2. Prompt the user to enter the number of courses they have left to
1. Define a two-dimension array with 10 rows and 2 columns.
2. Prompt the user to enter the number of courses they have left to graduate (value must be between 1 and 20) and the year they want to graduate
3. The program must store the number of courses and graduation year for each student in a different row of the array.
4. The program must compute the number of credits, and display this output, along with the year the student plans to graduate. Each course is worth 3 credits.
Step 3. Test your program using this data.
Student 1, 8 courses and plans to graduate in 2018
Student 2, 10 courses and plans to graduate in 2019
Student 3, 15 courses and plans to graduate in 2020
Student 4, 5 courses and plans to graduate in 2019
Student 5, 20 courses and plans to graduate in 2021 Note: enter 22 first time by mistake to test
Student 6, 7 courses and plans to graduate in 2019
Student 7, 9 courses and plans to graduate in 2020
Student 8, 3 courses and plans to graduate in 2018
Student 9, 7 courses and plans to graduate in 2018
Student 10, 18 courses and plans to graduate in 2021
Your output should look like the sample below.
1.-Problems @Javadoc ke Declaration e Console X Data Hierarchy terminated> C8 Project (Java Application] C:AProgram Filesavaljre1.8.0 131bin javaw.exe (Oct 26, 2017, 11:36:27 Enter classes and graduation year for student 1: 8 2018 Enter classes and graduation year for student 2: 10 2019 Enter classes and graduation year for student 3: 15 2820 Enter classes and graduation year for student 4: 5 2019 Enter classes and graduation year for student 5: 22 2821 The number of classes for student 5 is not valid! Enter classes and graduation year for student 5: The number of classes for student 5 is not valid! Enter classes and graduation year for student 5: 20 2821 Enter classes and graduation year for student 6: 7 2019 Enter classes and graduat year for student 7: 9 2020 Enter classes and gradu t Enter classes and g Enter classes a ear for student 8: 3 2018 on year for student 9: 7 2818 tion year for student 18: 18 2021 udeSeed,se Studen+1 Studentneeds 30 credits to graduate in 2819 Student 3 needs 45 credits to graduate in 2820 Student 4 needs 15 credits to graduate in 2019 Student 5 needs 60 credits to graduate in 2821 Student 6 needs 21 credits to graduate in 2019 Student 7 needs 27 credits to graduate in 2820 Student 8 needs 9 credits to graduate in 2018 Student 9 needs 21 credits to graduate in 2818 Student 10 needs 54 credits to graduate in 2021 24 credits to graduate in 2018
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started