Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create a class called InputData. It has two private data members data_a and data_b. Set the
values of these two data members by using two public functions get_a() and get_b(). Derive a class
called Arith_Unit from InputData. It contains the functions add(),sub(), mul(),div() to perform
arithmetic operations on data_a and data_b. Derive a class Logic_Unit from InputData. It
contains the functions and(), or() and xor() to perform logical operations on data_a and data_b.
Finally derive a class called ALUnit from Arith_Unit and Logic_Unit classes. It has to perform
arithmetic and logical operations according to the given codes. Choose code 0 to code 6 to perform
the said seven operations. Write sample program to test the ALU class.
Create a class Rational whose object can store a rational number. (For ex: 3⁄4). Include the
necessary constructors to initialize the objects and function to display the rational number in x/y
format. Define the following non-member functions.
addRational(Rational r1, Rational r2) : which should return a summation of the two input rational numbers r1 and r2.
mulRational(Rational r1, Rational r2) : which should return the product of the r1 and r2.
Set these two functions as friend to the Rational class
Main function to read two rational numbers and display the sum and product of the input by
calling the proper functions.

. Write a program having a Class Mile with data member dis_mile. Another Class Kilometer with data member dis_kilo. Both classes stores distances. In main function create objects these two classes with parameterized constructors. Write down conversion function for converting Kilometer object to Mile class object


Create a class Matrix to store a m x n matrix. Include necessary constructors and functions to
initialize and display the matrix. Using friend function, find the dot product of two input matrices.
Create a class Date whose object can store a day, month and year. Include the necessary
constructors to initialize the objects and function to display the date in ‘dd/mm/yyyy’ format.
Define a non-member function findAge(Date dob, Date today) which should return the calculated
age from the input dates ‘dob’ and ‘today’. Set this function as friend to Date class. Write a main
function to read the today’s date and date of birth of a person from the user and display the age
of that person by calling the proper function.

Write a program having Classes Rectangle with data members’ length and width, Square with data member side, EquilatralTraingle with data member side. All these classes are derived from class Shape. Write an independent function which will exhibit polymorphism and show the area of the object passed to the function. All data members of class are private; you can write suitable functions needed for you


write pseudocode for the mainlin logic that contains the elements requaired



C++ PROGRAMMING

The "TRC Institute" records and monitors performance of three (3) machines over a period of four (4) days (l to 4) as shown in the Table 1, 2 and 3 respectively. The production ranges between 15.5 and 75.5 

Table 1- Machine "A" Production

Day 1 2 3 4

Array index 0 1 2 3

Production 15.5 25.5 27.5 60.5

Table 2- Machine "B" Production

Day 1 2 3 4

Array index 0 1 2 3

Production 50 45.5 25.5 18

Table 3- Machine "C" Production

Day 1 2 3 4

Array index 1 2 3 4

Production 35.5 65 71 74.5

Write a function using C++ statements called PrintChart() which takes three float arrays (valuel, value2, value3) and an integer (as day) as parameters. The function calls GetProduction and PrintBar functions to print the output as given below.

Sample Output.

Day 1

Machine A **

Machine B  ***** 

Machine C   ****


Write a C++ program for implementing the following


a. Create a class called Employee with Employee name, Designation and Basic Pay as data members.



b.    Inherit a class called Allowance from Employee with HRA and DA as data members



c.     Inherit a class called Deductions from Employee with PF and Income Tax as data members



d.    Inherit class Salary from Allowance and Deductions which has Net pay as its data member.


Create an array of employees, calculate net pay for each employee and sort them (using operator overloading).


write a complete C++ program that: a) initially asks the user to enter five sets of first name, last name and age; b) extracts the first name initial from the entered first name; c) uses arrays to store the entered information; and d) displays on the output monitor all the five sets of entered information in a table form as shown in sample output below.


LATEST TUTORIALS
APPROVED BY CLIENTS