Write a second main program that provides a menu

Assignment Help Programming Languages
Reference no: EM131299549

1. Create an application called Registrar that has the following classes:

A Student class that minimally stores the following data ?elds for a student:

- name

- student id number

- number of credits

- total grade points earned

The following methods should also be provided:

- A constructor that initializes the name and id ?elds

- A method that returns the student name ?eld

- A method that returns the student ID ?eld

- A method that determines if two student objects are equal if their student id numbers are the same (override equals from the class Obj ect)

- Methods to set and retrieve the total number of credits

- Methods to set and retrieve the total number of grade points earned

- A method that returns the GPA (grade points divided by credits)

An Instructor class that minimally stores the following data ?elds for an instructor:

- name

- faculty id number

- department

The following methods should also be provided:

- A constructor that initializes the name and id ?elds

- Methods to set and retrieve the instructor's department

A Course class that minimally stores the following data for a course:

- name of the course

- course registration code

- maximum number of 35 students

- instructor

- number of students

- students registered in the course (an array)

The following methods should also be provided:

- A constructor that initializes the name, registration code, and maximum number of students

- Methods to set and retrieve the instructor

- A method to search for a student in the course; the search should be based on an ID number.

- A method to add a student to the course. If the course is full, then an exception with an appropriate message should be raised (try creating your own exception class for this). Also, be sure that the student is not already registered in the course. The list of students should be in the order that they registered.

- A method to remove a student from the course. If the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned above).

- A method that will allow Course objects to be output to a ?le using object serialization

- A method that will allow Course objects to be read in from a ?le created with Object serializtion

You will note that the Student and Instructor classes described above have some commonality. Create a Person class that captures this commonality and uses it as a base class for Student and Instructor. This class should be responsible for the name and id ?elds and also provide a toString method that returns a string of the form name, id. This will be the inherited toString method for the Student and Instructor classes.

a. Draw a UML diagram for this application.

b. Implement the previous classes in Java. Write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working.

c. Write a second main program that provides a menu to allow the user to

i. create a course, prompting the user for all of the course information,

ii. add students to the course,

iii. check to see if a student is registered in the course, and

iv. remove a student from the course.

d. Add to the previous menu the ability to save a course using object serialization.

Also add a menu choice to read in a course from a file given the course code.

Come up with a system of naming the file so that the user need only be asked the course code to load the course information from a file.

Reference no: EM131299549

Questions Cloud

Prepare a consolidation worksheet : ACCT302 Advanced Financial Accounting Assignment. Give all eliminating entries needed to prepare a consolidation worksheet for 20X9 assuming that Pie Co. uses the fully adjusted equity method to account for its investment in Strawberry Company
What is its percentageafter-tax cost of debt : Micro Spinoffs Inc. issued 20-year debt a year ago at par value with a coupon rate of 6%, paid annually. Today, the debt is selling at $1,130. If the firm's tax bracket is 30%, what is its percentageafter-tax cost of debt? Assume a face value of $..
Prepare a consolidated statement of comprehensive income : Prepare a consolidated statement of comprehensive income for the year ended 31 December 20X0.
Quantity reflects the marginal valuation : Consumer Surplus: The height of the demand curve at a given quantity reflects the marginal valuation of the last unit of that good consumed. For a normal good, an increase in income shifts the demand curve to the right and therefore increases its ..
Write a second main program that provides a menu : Write a second main program that provides a menu to allow the user to create a course, prompting the user for all of the course information,
Record journal entries for the transactions : Record journal entries for the following transactions for FY 2015. Make any computations to the nearest dollar. Journal entry explanations are not required. Use control accounts for revenues, expenditures and budgetary accounts. It is not necessar..
Provide an overview of the types of fee income : Provide an overview of the types of fee income your bank is generating.- How does it compare to the other income? What would their net income look like if you removed the fee income?
Evaluate the major sources of ethical problems in derivative : Evaluate ethical frameworks that may guide personal ethical decision-making when involved in derivatives or commodity markets.
Restrictions create jobs : Why do nations adopt trade restrictions? What impact do trade restrictions have on the economy? Do trade restrictions create jobs?

Reviews

Write a Review

Programming Languages Questions & Answers

  Proc mean data=ex1height

Proc mean data=EX1height;throws what sort of error message

  Write logic for application for company which wants reports

Write logic for the application for company which wants report containing breakdown of payroll by department. Input includes each employee?s last name, first name, department number.

  Write a class to accepts no parameters and returns no value

Write class named ParkingMeter containing:A method named tick that accepts no parameters and returns no value. tick decreases value of timeLeft by 1, but only if value of timeLeft is greater than 0.

  Program compares the number entered to the previous number

The program compares the number entered to the previous number. In the event that it is a duplicate number, the user will be prompted to enter a different number. Display the number to the screen as long as it is not a duplicate.

  How do we convert string values from keyboard to numeric

Let's discuss how to use the Java I/O classes such as the system and the scanner classes to do console IO and the JOptionPane class to do dialog based IO. How do we convert string values from keyboard to numeric values

  Modify the program to enter any amount of numbers

Modify the program in Exercise 2a so that the user can enter any amount of numbers up to 12 until a sentinel value is entered.

  Discuss the features of object oriented programming language

Discuss the features of object oriented programming languages. A perfect square is a number that can be expressed as the product of two equal integers. Draw a flowchart, and write a corresponding class oriented program to check if any entered numbe..

  This is a programming assignment and it needs you to write

this is a programming assignment and it requires you to write the pseudocode for a program that solves the following

  Write and execute one join query

Attach a .txt file showing the SQL query program, and a Microsoft Word file with an authentication screen shot that shows the output of this join query.

  Discuss the feasibility and practicality

In Coffee's (2006) article, IT professionals discuss the role application developers take in software security. Pick one of these IT experts, summarize his or her perspective on building security into software, and then discuss the feasibility and..

  Which of the following is not true about html5

Which of the following is not true about HTML5? o Better error handling o Reduce the need for external plug-in (like Flash)

  Explain the project manuals for python and java

Overview: Understand TCP socket programing by developing a (multi-threaded) Web server. You may use Python, Java, or C++ as the programing language. The project manuals for Python and Java are attached to this document, which have provided partial..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd