Company ABC in Kenya pays its employees based on a commission of the sales they make as illustrated in the table below:
Monthly Sales
Next 100,000
Above 350,000
Commission Rate
15%
25%
First 50,000
10%
Next 200,000
20%
Additionally, all employees are entitled to a basic commission of 20,000 per month.
a. Draw a flowchart that allows a HR employee to input an employee’s monthly sales, computes the commission due to the employee and displays it to the HR employee.
b. Write a C++ program implementation of the flowchart above.
Create a program that will make ask the user to input an integer then display the equivalent day of the week. 1 is Sunday, 2 is Monday and so on. If the inputted number is not within 1-7m output is ''Day is not available!''.
Use nested While loops to produce the following pattern:
! ! ! ! ! ! ! ! ! ! ! !
\ \ ! ! ! ! ! ! ! ! / /
\ \ \ \ ! ! ! ! / / / /
\ \ \ \ \ ! ! / / / / /
Write nested for c++ loops to produce the following output.
×××× / / / / / / / / ××××
××× / / / / / / \ \ ×××
×× / / / / \ \ \ \ ××
× / / \ \ \ \ \ \ ×
\ \ \ \ \ \ \ \
Write nested for c++ loops to produce the following output.
×××× / / / / / / / / ××××
××× / / / / / / \ \ ×××
×× / / / / \ \ \ \ ××
× / / \ \ \ \ \ \ ×
\ \ \ \ \ \ \ \
In the Virtual Circuit (VC) Subnet (refer the course material “Session 20 Network Layer Functionalities” in Moodle) every circuit will have a VC ID and the routing table includes the VC IDs to manage the circuits. But, the problem with VC ID is it is local to the system; VC IDs are assigned by the host system itself without the knowledge of VC IDs assigned by the other hosts. Because of which there will be a clash of VC IDs at the router. Understanding the ambiguity, the router then changes one of the VC IDs to a unique ID at router level and proceeds with data transfer (refer Slide No. 12 of the course material). Over and above the data transfer, this is the additional responsibility for a router which creates hiccups in the data communication. Question: Design a network system where VC IDs will be assigned uniquely which avoids VC ID collision at routers. Since such a system avoids the VC ID collision at the router, it should definitely save router's time and should improve performance of router.
There is only one kind of manager in the EMPMULT program in this chapter. Any serious
company has executives as well as managers. From the manager class derive a class
called executive. (We’ll assume an executive is a high-end kind of manager.) The additional data in the executive class will be the size of the employee’s yearly bonus and the
number of shares of company stock held in his or her stock-option plan. Add the appropriate
member functions so these data items can be input and displayed along with the other
manager data.
Create and Implement a C++ program to overload ++ operators for the class Time.
Data members should be hour, minute and seconds.
Set data members as zero in default constructor.
Take one object in main to set 23:24:59 hrs.
Display time in the given format 23:24:59 hrs.
Overload ++ operator to make a stop watch. (i.e. that will increment seconds by 1 each
time its called)
Make a function by name add_time() to increment seconds.
Write a driver program to test your class.
Create and Implement a C++ program to overload >, <, == operators for the class Complex
numbers. Take two objects of class and compare both objects. Write a driver program to test
your class.
Create and Implement a C++ program to make a class box. Set values of its data members i.e.
length, width and breadth using constructor. Make member function to display the volume of
box. Use operator overloading to add, subtract, multiply and divide the data members (using
objects in main) length, breadth and width. Show volume of each overloaded operator’s
object. Write a driver program to test your class.