Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question 1: Build an Employee class containing the following information: - Code, full name (string type). - Number of workdays (integer) (value>0) - Sort

C++

Question 1: Build an Employee class containing the following information:

- Code, full name (string type).

- Number of workdays (integer) (value>0)

- Sort (char(A,B,C)). The results of the emulation are based on the following rules:

+ Number of working days > 26 : grade A

+ 26 > = Number of working days > = 22 : type B

+ Number of working days < 22 : C type

- Daily salary (200,000 VND): applied to all employees and static members.

Let's build the following methods:

- The get/set method for each property has a constraint check according to the above requirement.

- 3 initialization methods

- Cancellation method

- Import/export employee information.

- Salary calculation method (number of working days * daily salary).

- Bonus calculation method: if grade A, bonus 5% salary, grade B bonus 2% salary

and class C does not reward.

//SV self-build main function to test the methods written in the class

Question 2: Building a Beverage Class includes the following information:

- Row name (string)

- Unit (string)

- Quantity (int) (>0)

- Unit price (float) (>0)

- VAT (float): applies to all types of soft drinks and the value can be changed by

time.

Write the following methods:

- Declare necessary properties and constructors with parameters. Note: unit of measure

receive only 1 of 4 values: connect, barrel, bottle, lon. If the unit is not in 1 thuc

in the above 4 values, the unit of calculation will be term

- Initialization method, destruction method

- Other processing methods

+ Build a method to calculate money based on the unit of calculation (DVT) as follows:

- DVT = link or box -> into money = quantity * unit price* VAT

- DVT = bottle -> amount = quantity * (unit price / 20)*VAT

- DVT = lon -> amount = quantity * (unit price / 24)*VAT

+ Method of importing/exporting beverage information.

- Write main function to check the components of beverage 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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions