I am in an intro Java Programming class. In the beginning Java seemed simple and easy until the class got to multiple methods and loops. I have an assignment that was due (I did not turn in because of frustration). Anyway, would anyone be able to help me? Thank you in advance!
Here are the program specifications:
Scanner Input specifications:
Invoice Number
Customer Name
Customer Type - Limited to: "R" - retail, or "C" - commercial
Customer State - Limited to:" PA", "OH", and "WV"
Municipality Tax - Limited to: "Y" - yes, or "N" - no
Type of Sale - Limited to: "G" - ground, "W" - web or online
Merchandise Subtotal - Total of merchandise without Customer Type Discounts, Sales tax or Freight, and Other Charges
Freight Charges
Other Charges
Output:
Invoice Number - as entered as input
Customer Name - as entered as input
Type of Sale - as entered as input.
Merchandise Subtotal
Discount - to be conditionally calculated. Based on Customer Type
Freight Charges - as entered as input
Other Charges - as entered as input
Sales Tax Percentage - to be determined
Sales Tax - to be conditionally calculated
Total Invoice - to be unconditionally calculated as: Merchandise Subtotal - Customer Discount + Freight + Other Charges + Sales Tax
1. Declare and initialize variables and objects as class variables and objects. Class variables and object declaration must be outside a method. Most Java programmers declare class variables and objects immediately after the class header, but before the main method. Class variables and objects may be used by any method within class. This application modular design will require multiple methods.
2. Main method - Use Scanner input requirements and the Console outputs. The Total Invoice equals Merchandise Subtotal - Customer Discount + Freight + Other Charges + Sales Tax. Apply the NumberFormat class as appropriate. Execute the application, enter sample data and review the console outputs for accuracy and format.
3. Add a While Loop -Pre-loop test to enter zero or more invoices at the description of the user. Test the added pre-loop design. Execute the application and test the ability to process no invoices, multiple invoices and stop. Please add a console output message after the loop that the program has been completed, so that one can clearly determine that the program has stopped (not just hung up).