Question
Complete the Programming of an Object-Oriented Console Application You have been hired to complete the source code of these two methods such that the application
Complete the Programming of an Object-Oriented Console Application
You have been hired to complete the source code of these two methods such that the application meets its stated requirements. Specifically, your added code should: In one method, prints out a list of courses available for registration and prompt the user to select a course for which to register In the second method, prints out a current list of registered courses and their total credit hours The requirements of this application are as follows: The application is register students for courses in a term of study. The assumptions used by the application are: Student enter only integers to select courses for registration from a menu. No data type validation of the user menu selection is checked or required The program terminates only when the student closes it The program must follow these registration business rules: No registration of other courses not displayed by the program No registration more than once for the same course No registration for more than 9 credit hours (e.g. no more than 3 courses) The application uses Java Object-Oriented features for its implementation. Students select from a menu of courses for which they wish to register. The program then validates the user selection against the registration business rules. If the selection is valid, the program prints out a confirmation message. Otherwise, the program prints out the current list of registered classes along with total registered credit hours. The program terminates when the user does not want to register for classes any more. There are two Java classes of this application:
1. Course.java. This Java class is complete and does not need any modification 2. U10A1_OOConsoleRegisterForCourse.java. This is the class with the two methods that need to be completed The two methods that need to be completed of the U10A1_OOConsoleRegisterForCourse.java are:
1. getChoice() method. This method loops over an array of course objects and prints out their attributes, one per line according to this format: [selection number]Course Code (Course Credit Hours)
2. WriteCurrentRegistration() method. This method also loops over the array of course objects and prints out a list of registered courses thus far. The list current registered courses are enclosed inside a { } and separated by a ,. The methods also prints out the total credit hours thus far Use these course codes, in this order, to test your application: IT2230 IT2249 IT2230 IT3345
Successful completion of this assignment will display a menu of courses from which to select to register in the format of [selection number]Course Code (Course Credit Hours) In addition, the application should display and update current list of registered courses and their total credit hours. Your program interaction should look like the sample interaction video, OO Console Register for Course Follow these steps to complete this assignment:
1. Complete the application programming (the getChoice() and the WriteCurrentRegistration() method) to meet the stated requirements. 2. Compile and test your application using the provided input data. 3. Explain the approach you took to complete this assignment and the major decisions you made. As part of your explanation, be sure to identify the fundamental Java constructs you used that were specific and relevant to your submitted program.
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package u10d1_instantiateusearrayofobjects;
/** * * @author omora */ public class U10D1_InstantiateUseArrayOfObjects {
/** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Course[] courses = { new Course("IT1006", 6, false), new Course("IT4782", 3, false), new Course("IT4789", 3, false), new Course("IT4079", 6, false), new Course("IT2230", 3, true), new Course("IT3345", 3, true), new Course("IT2249", 6, false) }; WriteCurrentRegistration(courses); } //This method prints the current list of registered courses thus far //from the courses array separated by , and enclosed inside { } //It also prints the total credit registered for thus far public static void WriteCurrentRegistration(Course[] courses) {
//TODO: //loop over the courses array and print //the current list of registered courses //separated by , and enclosed inside { } //Also, print the total credit registered for } }
Final output screen shot. Thanks for the help. Not a coder.
23 System.out.println"Teache Copy" TT4182 (3) 31IT4T89 (3) 41111079(6) TT2230 3) 16JIT3345 (3) 711T2249 (6) Enter vour chaice 6 Invalid** - You can not registor tor moro than9 credit hour Current coure registration IT2230, IT2249 Current registration total credit-9 Do you wanl Lo Lry again? (YN? Thank you for reqistering with usStep 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