Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

UCF - COP 3 3 3 0 - unit 2 . hw ( Another look at Unit 1 . hw ) At Simple College, a

UCF-COP 3330-unit2.hw
(Another look at Unit1.hw)
At Simple College, a student must take exactly two classes. The purpose of
this assignment is to write a Java program that generates a fee invoice
for a student. That requires the input of Students id and full name as
Strings, the two course numbers and their corresponding credit hours (See
sample run below).
It costs 120.25 dollars per one credit hour, and each student is charged
$35.00 for health and id services.
After inputting all the necessary data (see sample run below), an invoice,
as shown below, is printed to the screen.
SIMPLE COLLEGE
ORLANDO FL 10101
*************************
Fee Invoice Prepared for:
[Ericka J. Jones][V5656]
1 Credit Hour = $120.25
CRN CREDIT HOURS
45874 $481.00
45993 $360.75
Health & id fees $35.00
----------------------------------------
Total Payments $876.75
1) You may assume that the user of your code enters correct information
(No need to worry about any exception handling). Also, it is not
required to have the exact number of white spaces/skipped lines as
shown in the invoice above, but a similar indentation is expected.
2) Submit your code, the .java file. Check that you submitted the
correct file. Please dont ask the instructor to check your code or
to check if you have submitted the correct file!
3) Whether your work solo or in groups, submission of the hw on
Webcourses is individual. If you end up working on this hw in groups
(up to 3 per group), write the full name of all the group members, as
a comment.
This time, you will create two classes: FeeInvoice and DriverClass.
1) The FeeInvoice class has the following fields and methods:
studentName and studentId: String
crn1, creditHours1, crn2 and creditHours2: int
(Note that data is to be set as private!)
_______
- Setters and getters for all the fileds. Note that you may
choose not to invoke the setters and the getters, but have
them in all cases.
- One constructor:
FeeInvoice(string studentName ,
string studentid ,
int crn1,
int creditHours1,
int crn2,
int creditHours2)
- private double calculateTotalPayment () to return the total
payment amount.
- public void printFeeInvoice () to print the invoice as shown
in the sample run below. Note that this method should call
calculateTotalPayment to get the total amount.
2) A skeleton for the DriverClass and FeeInvoide classes is provided
below (DriverClass.java). Once done, submit your DriverClass.java
Once again, submit one .jave file
//unit2.hw
//Group members: John Jones, Jenna Johnson, James Junaid
//imports...
public class DriverClass {
public static void main(String[] args){
String studentName, studentId;
int crn1, creditHours1, crn2, crediHours2;
Scanner scanner = new Scanner ( System.in );
//Ask the user to enter the name , id , the crns and the credit hours as
//show in the sample run (yes exactly as shown in the sample run!)
//Instantiation of FeeInvoice
FeeInvoice feeInvoice = new FeeInvoice ( studentName ,
studentId ,
crn1,
creditHours1,
crn2,
creditHours2) ;
//Printing the fee invoice
feeInvoice.printFeeInvoice ();
}//end of main
}
//---------------------------
class FeeInvoice {
//add code as specified ...
}
Sample Run (The users keyboard try is marked in bold)
Enter the Students Id: V5656
Enter the Students full name: Ericka J. Jones
Enter crn/credit hours for the first class: 4587/4
Enter crn/credit hours for the second class: 4599/3
Thank you!
HERE IS THE FEE INVOICE...
SIMPLE COLLEGE
ORLANDO FL 10101
*************************
Fee Invoice Prepared for:
[Ericka J. Jones][V5656]
1 Credit Hour = $120.25
CRN CREDIT HOURS
45874 $481.00
45993 $360.75
Health & id fees $35.00
----------------------------------------
Total Payments $876.75

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions