Question
Create a class named Purchase that contains Fields for an invoice number, sales amount, sales tax amount and the number of items. Choose an appropriate
Create a class named Purchase that contains Fields for an invoice number, sales amount, sales tax amount and the number of items. Choose an appropriate data type for each of the fields. A default constructor. A parameterized constructor that accept invoice number, sales amount and number of items. Required properties. A ToString() method to display information. A method CalculateSalesTax() to calculate sales tax amount as 5% of the sales amount. A method CalculateShippingCharges() to calculate shipping charges based on the number of items purchased. Use the following information to determine the shipping charges: Fewer than 3 items ------------ $3.50 3 to 6 items --------------------- $5.00 7 to 10 items -------------------- $7.00 More than 10 items ------------ $10.00
Create another class named PurchaseApp. This class allows the user to input data including invoice number, sales amount and number of items purchased. Note: Sales tax amount will be calculated using CalculateSalesTax() method. When you prompt for an invoice number, do not let the user proceed until a valid invoice number between 1000 and 9000 has been entered. CSIS-1175-002 (Midterm) 2 | P a g e When you prompt for a sale amount, do not let the user proceed until the user has entered a nonnegative value. Create at least two objects of the Purchase class. Display invoice number, sales amount, sales tax rate, sales tax amount, shipping charges and total amount for each of the objects as shown in the sample output. Note: Dont forget to add comments. More methods can also be created in PurchaseApp class if needed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started