For this assignment, you will be adding additional logic to handle a few additional properties of the order, the simple validation of properties, and the total cost of the order, including sales tax. You will implement these new capabilities using methods that you create. Define the method called getStringInput( ) using the method header: private static String getStringInput(String prompt) This method must do the following: Use Scanner class to take the input Check the value that is returned. If the value is null, the program should terminate. If the value is a non-empty string, that string should be returned as the value of the method. Otherwise, this request sequence should be repeated up to 3 times. If the customer has not entered a valid input by then, the program should make an appropriate comment and then terminate. Replace your existing code that requests the customer’s name, return status, and color with calls to getStringInput( ). Add a request for quantity, or the number of items that the customer wishes to order. Use getStringInput( ) to obtain this value from the customer. You will need to convert the quantity string into an int value. You should use the Integer.parseInt( ) method to accomplish this. Create a method called totalCost( ) that calculates the total cost of an order. Use the following header: private static double totalCost(int number, double cost, double salesTaxRate) The number is the number of items (the quantity), the cost is the unit cost (the cost of a single item), and sales tax is the sales tax rate. You should select a reasonable value for the unit cost (e.g., $10.00). You should select a reasonable value for the sales tax rate (e.g., 7%). Use your totalCost( ) method to calculate the total cost of the order.
https://proessaytutors.com/wp-content/uploads/2020/08/proessaytutors.png 0 0 Admin https://proessaytutors.com/wp-content/uploads/2020/08/proessaytutors.png Admin2020-08-18 02:55:172020-08-18 02:55:17For this assignment, you will be adding additional logic to handle a few additional properties of the order, the simple validation of properties, and the total cost of the order, including sales tax. You will implement these new capabilities using methods
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!