Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class named Order that performs processing of a single item. The class has five fields: customer name, customer number, quantity ordered, unit price,
Create a class named Order that performs processing of a single item. The class has
five fields: customer name, customer number, quantity ordered, unit price, and
total price. Include set and get methods for each field except the total price
field. The set methods prompt the user for values for each field. This class also
needs a method named computePrice to compute the total price (unit price times
quantity ordered) and a method to
display the field values. Create a subclass named
Shippedorder that overrides computePrice by adding a shipping and handling charge
of RM12.00. Write an application named UseOrder that creates an object for each of
these classes. Prompt the user for data for the Shippedorder object, and display
the results.
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