Complete the following tasks:a. Create a class named Order that

Complete the following tasks:

a. Create a class named Order that performs order processing of a single item. The class has four fields: customer name, customer number, quantity ordered, and unit price. Include set and get methods for each field. The set methods prompt the user for values for each field. This class also needs a computePrice() method to compute the total price (quantity multiplied by unit price) and a method to display the field values.

b. Create a subclass named ShippedOrder that overrides computePrice() by adding a shipping and handling charge of $4.00.

c. Create the logic for an application that instantiates an object of each of these two classes. Prompt the user for data for the Order object and display the results; then prompt the user for data for the ShippedOrder object and display the results.

d. Create the logic for an application that continuously prompts for order information until the user enters ZZZ for the customer name or 10 orders have been taken, whichever comes first. Ask the user whether each order will be shipped, and create an Order or a ShippedOrder appropriately. Store each order in an array element. When the user finishes entering data, display all the order information taken as well as the total price that was computed for each order.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top