Question: You created a class named Purchase. Each Purchase contains an invoice number, amount of sale, amount of sales tax, and several methods. Now, write a

You created a class named Purchase. Each Purchase contains an invoice number, amount of sale, amount of sales tax, and several methods. Now, write a program that declares an array of five Purchase objects and prompt a user for their values. As each Purchase object is created, continuously prompt until the user enters an invoice number between 1000 and 8000 inclusive and a non-negative sale amount. Prompt the user for values for each object and then display all the values. Save the file as PurchaseArray.java.

Step by Step Solution

3.57 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class Purchase private int invoiceNumber private double saleAmount priva... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!