6. Create a class named Purchase. Each Purchase contains an invoice number, amount of sale and amount of sales tax. Add

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
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

Post by answerhappygod »

6 Create A Class Named Purchase Each Purchase Contains An Invoice Number Amount Of Sale And Amount Of Sales Tax Add 1
6 Create A Class Named Purchase Each Purchase Contains An Invoice Number Amount Of Sale And Amount Of Sales Tax Add 1 (26.68 KiB) Viewed 43 times
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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply