Question
Programming Assignment 2 Scenario: You have been hired by GMU to create and manage their course registration portal. The university is offering six IT courses
Programming Assignment 2
Scenario: You have been hired by GMU to create and manage their course registration portal. The university is offering six IT courses in Fall 2023. Each course has a course number, course name, credit hour, and current enrollment. The course number must be 5 characters long. The maximum enrollment for each course is 30 students. The current enrollment should be no greater than the maximum enrollment. A course can have a maximum of 4 credit hour. Design and implement a modular solution for the above task. Your solution must have the following methods:
Get Course Number: This method should prompt the user for a course number, validate the number, if its invalid show an error message and re-prompt. At the end, the method should return a valid course number.
Get Course Name: This method should prompt the user for a course name. The course name cannot be empty. If the user provides an empty string, show an error message and re-prompt. At the end, the method should return a valid course name.
Get Credit Hour: This method should prompt the user for a course credit hour, validate the input, if its invalid show an error message and re-prompt. At the end, the method should return a valid credit hour.
Get Enrollment: This method should prompt the user for a courses current enrollment, validate the input, if its invalid show an error message and re-prompt. At the end, the method should return the valid input.
Print Course Details: This method should print all the information of the courses entered. This method should also print the maximum and average enrollment over all the courses.
Sample Input/Output
Enter Details for Course 01:
Enter Course Number: IT106
Enter Course Name: Intro to Programming
Enter Credit Hour: 4
Enter Current Enrollment: 27
Enter Details for Course 02:
Enter Course Number: IT206
Enter Course Name: OOP
Enter Credit Hour: 4
Enter Current Enrollment: 29
Enter Details for Course 03:
Enter Course Number: IT109
Enter Course Name: Intro. Programming
Enter Credit Hour: 4
Enter Current Enrollment: 20
Enter Details for Course 04:
Enter Course Number: IT191
Enter Course Name: Computer Fundamentals.
Enter Credit Hour: 3
Enter Current Enrollment: 12
Enter Details for Course 05:
Enter Course Number: IT102
Enter Course Name: Discrete Math
Enter Credit Hour: 4
Enter Current Enrollment: 27
Enter Details for Course 06:
Enter Course Number: IT207
Enter Course Name: Applied IT Programming
Enter Credit Hour: 3
Enter Current Enrollment: 15
Test Case 2 (Invalid Inputs):
Sample output
Enter Course Number: IT123456
Error!! Course Number is invalid must be 5 characters long please re-enter Course number!!
Re-Enter Course Number: IT106
Enter Course Name: Object Oriented Techniques for IT Problem Solving
Enter Credit Hour: 9 Error! Course Credit is invalid course credit can be a maximum of 4 please re-enter Course number!!
Re-Enter Course Credit: 4
Enter Current Enrollment: 35
Error! Course Enrollment is invalid course enrollment can be a maximum of 30 please re-enter Course number!!
Re-Enter Course Enrollment: 20
Notes: Your solution must use Modular Programming.
Your solution must not use arrays.
Your solution must contain appropriate validation. Try to think about what might be considered appropriate as you are designing your solution beyond what has already been explicitly provided.
Your solution may not use any functions or language constructs not covered during this semesters IT 106 without prior authorization from your instructor, even if you know other functions or language constructs. Using something existing not discussed in class does not give you as much practice as solving the problem yourself. Doing this may lead to a substantial grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask!
You must use the JOptionPane class for input/output. Additionally, if you use System.exit as shown in the textbook, it may only be used as the absolute last line in the program. You may not use System.exit, or any variant that exits the program in the middle of the program. The program should be designed to only exit once the algorithm has finished. Hints: You do not need to use arrays to solve this problem. Keep in mind once you have finished entering the information for one course, it is not necessary to keep the information.
Hints:
You do not need to use arrays to solve this problem. Keep in mind once you have finished entering the information for one course, it is not necessary to keep the information.
Requirement:
Upload the .java file of the program to Blackboard. Be careful that you do not submit a .class file instead of a .java file. Your program must successfully compile using jGrasp. You are discouraged from using IDEs other than jGrasp.
Grading Criteria Requirement Points
Implementation of Java Program, using efficient practices where appropriate, such as the use of constants, good variable names, no redundant code, etc. 90
Appropriate objective-style documentation and intermediate comments 10
Course Details Course Number| Course Name| Credit Hour| Enrollment IT106 | Intro to Programming | 4.0| 27 IT206 | OOP | 3.0 | 29 IT109 | Intro Programming| 4.0| 20 IT191 | Computer Fundamental | 3.0 | 12 IT102 | Discrete Math | 4.0 | 27 IT207 | Applied IT Programmming | 3.0 | 15 The maximum enrollment is 29 in IT106 The Average enrollment is 21Step 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