java language
6. Create a class named Purchase. Each Purchase contains an invoice number, amount of sale and amount of sales tax. Add a no-argument constructor which initializes invoice number to 0, sale amount and sales tax to 0.0 and a constructor that initializes all instance variables through the parameters. Include a set method for the invoice number and two overloaded setSale Amount() methods: • void setsaleAmount (double amount) // set of sale only void setsaleAmout (double amount, double rate) //set sale amount and calculate sales tax based on the second argument Also include a display0 method that displays a purchase's details. amount Create an application that declares a Purchase object and prompts the user for purchase details. Set all the purchase details to the Purchase object. Finally, display the objects invoice number, sale amount and sales tax.
6. Create a class named Purchase. Each Purchase contains an invoice number, amount of sale and amount of sales tax. Add
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
6. Create a class named Purchase. Each Purchase contains an invoice number, amount of sale and amount of sales tax. Add
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!