Application that calculates and displays the total payable

Assignment Help JAVA Programming
Reference no: EM13897476

Assessment task

Write a java application that calculates and displays the total payable after applying discount on online grocery orders for N customers. The N should be set as a constant (final) in your application and choose a value between 7 and 9. The discount rates are as shown below in Table 1.

Table 1: Discount Details

Purchase Amount

Applicable Discount Rate %

Below $75

0%

>= $75 and < $100

5%

>= $100 and < $150

7%

>= $150 and < $200

9%

>= $200

11%

The program should ask the user to enter the first name of the customer and the total purchase amount in dollars. The purchase amount should be between 10 and 400. Validate the user input, display error message and allow the user to correct the error by reading two more entries for the purchase amount.

Based on the purchase amount, the program should apply the applicable discount and calculate the total payable amount. The application should display a message with first name, and total payable. At the end of the Nth customer the program should display a summary of purchases displaying the largest purchase amount, smallest purchase amount, total payable for all customers, and total discount amount applied. The format of your input and output must be same as given in example below.

Enter the name for Customer 1: John
Enter the purchase amount for Customer 1: 68 Hi John, the total payable is $68.0

Enter the name for Customer 2: Sally
Enter the purchase amount for Customer 2: 95 Hi Sally, the total payable is $90.25

Enter the name for Customer 3: James
Enter the purchase amount for Customer 3: 140 Hi James, the total payable is $130.20

The application should be user-friendly by displaying appropriate welcome and exit messages. The following classes and methods could be used.

public class Customer
{
//declare constants
//declare fields/attributes to store the name and purchase amount
// constructor
// Accessor, mutator methods (get and set )
// Method to calculate total payable applying discount.
}

public class CustomerTest
{
//declare constants required
public static void main(String[] args)
{
//create object
//Loop through taking user input for name and purchase amount and use set methods
//calculate total payable using the defined method
// compute other required values
//print output as shown in the example
}
}

Note: Once you complete coding and testing, go through the marking criteria to ensure that your application meets all the requirements. Avoid any sort of plagiarism.

Reference no: EM13897476

Questions Cloud

What percentage ownership typically defines fdi : What percentage ownership typically defines FDI? What is agency theory? How does corporate governance address the issues raised by agency theory?
What are the major multilateral development banks : What are the major multilateral development banks? What is the WTO? What is its role in the world economy? What is an institutional investor?
What is the origin of the high absorptivity absorptions : Match the five complexes grven below (by letter) with the proper spectral data in the chart below. Al1 of these complexes have low spin d6 configurations and display t'*ro d-d transitions (low absorptivity). Two additional absorptions with high mo..
How does the hope of the resurrection play a role : How does the hope of the resurrection play a role in comforting Wolterstorff?
Application that calculates and displays the total payable : Write a java application that calculates and displays the total payable after applying discount on online grocery orders for N customers. The N should be set as a constant (final) in your application and choose a value between 7 and 9.
Los angeles photography gallery : Surf on over to zonezero.com, the website for a Los Angeles photography gallery. Take your time, look around, and choose a photo that particularly stands out to you.
What is the structure of the foreign exchange market : What is the structure of the foreign exchange market? Is it like the New York Stock Exchange? What is a spot exchange rate contract? When does delivery occur on a spot contract?
Create a communication plan for mother and child for both : Create a communication plan for mother and child for both prescriptive and non-prescriptive drug therapies
Define the major types of job analysis methods : Define the major types of job analysis methods and their specific approaches

Reviews

Write a Review

JAVA Programming Questions & Answers

  Polymorphism concepts

Explain polymorphism concepts in java

  What is one example from the list in table of popular

based on the keston 2013 article what are the advantages and disadvantages of using mashups? what is one example from

  Implement the jvm dload instruction for the mic-two

Implement the JVM DLOAD instruction for the Mic-2. It has a 1-byte index and pushes the local variable at this position onto the stack. Then it pushes the next higher word onto the stack as well.

  A class for counting the number of people

Specification: A class for counting the number of people in a room. This might be used to control how many people are allowed into a club with a doorman.

  Create exception classes

First, create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException. Both NumberHighException and NumberLowException should be directly subclassed from the Exception class, but NumberNegativeException s..

  Graphics program that draws 12 strings

Write a graphics program that draws 12 strings, one each for the 12 standard colors, besides Color.WHITE, each in its own color. Provide a class ColorNameViewer and a class ColorNameComponent.

  Create a messageframe class extending jframe

Create a MessageFrame class extending JFrame and a MessagePanel class extending JPanel.

  Three most primary forms of loops: the while loop, the do..

explored the world of loops we have accepted the three most primary forms of loops: the while loop, the do...while loop (even though Python does not use this loop), and the for loop. The for loop has approximately three primary implementations that w..

  Write a program that reads a number in feet

Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters. INPUT and PROMPTS.The program prompts for the feet with the message "Enter a value for feet:

  Write an application that uses an array

Write an application that uses an Array to store 10 messages of type String. You can load this data structure with 10 messages of your choosing.

  Compare swing java gui components to awt components

Compare Swing Java GUI components to AWT components. Explain at least one way the components are similar and at least one way they are different.

  Create a structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.

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