Complete the following tasks:a. Design a class named Cake. Data

Complete the following tasks:

a. Design a class named Cake. Data fields include two string fields for cake flavor and icing flavor and numeric fields for diameter in inches and price. Include methods to get and set values for each of these fields. Create the class diagram and write the pseudocode that defines the class.

b. Design an application that declares two Cake objects and sets and displays their values.

c. Design an application that declares an array of 250 Cake objects. Prompt the user for data for each of Cake, then display all the values.

d. Design an application that declares an array of 25 Cake objects. Prompt the user for a flavor, icing, and diameter for each Cake, and pass each object to a method that computes the price and returns the complete Cake object to the main program. Then display all the Cake values. An 8−inch cake is $19.99, a 9−inch cake is $22.99, and a 10−inch cake is $25.99. Any other entered size is invalid and should cause the price to be set to 0.

 

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