Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a class that manages a Pet Food Company's quarterly summarized activity. It should contain the following: ( This is all private data ) Company

Design a class that manages a Pet Food Company's quarterly summarized activity. It should contain the following: ( This is all private data ) Company Name - char[40] // This is a static member Quarter - char // This is a static member. Validate to be 1-4 in the setter methodDivision Name - char[40] BonusBudgetRate - float - set to 0.02 Total Sales - floatTotal Expenses - float

Also create a public method named netIncome which will return total sales - total expenses as float.

2. Create public class methods (Setters and Getters) that load the data values. 3. Do not create getter/setter methods for the BonusBudgetRate item. It can be set in a constructor or initialized to the default value of 0.02. There is no other reference to it. 4. Create 3 instances of the class - dogFoodMaker, catFoodMaker, fishFoodMaker.

5. Prompt me to enter the Company Name and Quarter only once. Internally set the division name for each instance. (I.E. "Dog Company" for dogFoorMaker, "Cat FoodCO" to CatFoodMaker, etc) For each of the above instances, prompt me for total sales and total expenses. 6. For each instance of the class, display the Company Name, Quarter. Division Name, Total Sales, Total Expenses and Net Income. The company name should be available in all instances.

The deliverable is a working program (CPPs & H files) and a UML diagram of the this class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions