Hello everyone, This is my first time posting here.
I have this assignment that is due this week. I am having a few issues with some of the aspects of the assignment.
Here is a summary of the assignment
You are a consultant for an IT consulting firm. You need a program that will calculate the invoice for a client and then print out an invoice to the screen. The consulting rate is $200 per hour.
Your program should have the following options:
1. Add Client
2. Create Invoice
If the first option is selected the consultant will enter the clients name, id #, address and number of hours worked.
If the second option is selected the consultant will be asked for a client's ID #. If the client exists then an invoice will be displayed to the screen that shows the client's Id#, address, name, the number of hours worked, the consulting rate, and the total amount of the bill. Also, include a tax rate of 8%. If the client does not exist then display a message to the screen telling the consultant that the client must be added before an invoice can be created for the client.
You should be able to add multiple clients and create multiple invoices before quitting the program.
You will need a client and an invoice class. Identify the attributes needed for the client class and the invoice class. You will need accessor, mutator methods, and constructors. Your invoice class will need to calculate the total price for the hours worked, the amount of tax owed, and return the total for your invoice.
So far In the client class i have clientname,clientaddress,clientid,clienthours.
In the invoice class I have payrate and taxrate.
I think I may need to use arrays to store the values since it says that we should be able to add multiple clients and invoices.
I also wanted to know how to loop the switch statement so that if you select 1 or 2 it continues to ask you to select an option.
Here is some of the code that I have for the switch statements
int select = scan.nextInt();
System.out.println("Please enter the Client's Name: ");
String name = scan.next();
System.out.println("Please enter the Client's ID Number: ");
int id = scan.nextInt();
System.out.println("Please enter the Client's Address: ");
String address = scan.next();
System.out.println("Please enter the number of hours worked: ");
double hours = scan.nextDouble();
System.out.println("Invalid Selection, please select again.");
Thank you for any help you can give.