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 DATE to read the date and overload ++ (both prefix
and postfix) to generate the next date.
For Example, if d = 15/8/2019 output d++ or ++d should return
16/8/2019. Consider all possible test cases.
Create a class student with name, roll number, marks of 5 subjects
as data variables and use friend functions to read and display
student details.
Overload <, <= , > and > = operators to compare the total marks
scored by the student.
For example, if 40,60,50,50,100 are marks of students S1, and
100,100,100,100,100 are the marks of student S2 then S1 < S2, S1
<= S2 should return true and S1 > S2, S1 >= S2 should return false.
Faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be
deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300)
will be deducted, if a faculty member offends three times in a month GHs 900
(i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e.
200+300+400+500). Assuming all faculty
members are on a flat salary rate of GHs 2500.

a. Write a program to request for the names of four faculty members and
number times he/she has absented him/herself from class. One of them
should have absented him/herself once, another twice, another three times
and another four times.
a) You are to define a class named NobelAward. Your class must have two
functions, one of the functions should be named AwardCategory, and the
other function should be named AwardWinner. Your AwardCategory
must have a string argument and return the string when called. Your
AwardWinner function must contain two parameters, one should be a
string called name and the other an integer called votes. When called
(AwardWinner) it should return the name and highest votes as the winner
for a particular category.

b) For each category, your program should request for three different names
of nominee and number of votes for each nominee. Your function in “a” above should select the name of the nominee with the highest number of votes as the winner for that category. If there is a tie, in the number of votes, then all the nominee should be declared as winner.

c) Critically explain the logic behind your code to student from another department.
The Nobel peace prize. The process of selecting the winners for the various prices have been criticized as being biased especially from the side of the panel members. The committee of experts at a general council meeting decided to automate the selection process. On a trial bases, you have been engaged to develop a system that will automatically select a nominee as the winner of the award in two categories (peace and science). Your program should have the following functionalities.

a) Define a class named NobelAward. Your class must have two
functions, one of the functions should be named AwardCategory, and the
other function should be named AwardWinner. Your AwardCategory
must have a string argument and return the string when called. Your
AwardWinner function must contain two parameters, one should be a string called name and the other an integer called votes. When called (AwardWinner) it should return the name and highest votes as the winner for a particular category.

For this task you are asked to write a program that consists of a le recap.cpp and a

make le to compile and run it. You will need to include a blank data.txt le in your

submission as well. Your make fille must compile the executable as main. You are required to read this data, line by line, into a 2D dynamic array of strings.

The format of the line is as follows:

1,a,b,c,d

Each line starts with an ID, which is an int, and then will be followed by an unknown

number of strings separated by commas. Each string in the line is associated with the ID

of the line. Each line will have at least the ID and 1 item.

Once the items are stored in the array you need to print out the array in ascending order

based on the order IDs in the following format:

ID,a,b,c

An example of this output is as follows (for 2 orders):

3,toaster,iron

4,spanner,wrench,hammer

Terminate each line of output with a newline.

The following libraries are allowed:

- iostream

- fstream

- string

- sstream


Given the following declaration:
int j;
int sum;
float sale[10][7];
which of the following correctly finds the sum of the elements of the fifth row of sale?
1. sum = 0;
for(j = 0; j < 7; j++)
sum = sum + sale[5][j];
2. sum = 0;
for(j = 0; j < 7; j++)
sum = sum + sale[4][j];
3. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[5][j];
4. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[4][j];
Write a C++ program to check if 2 matrices are same b overloading == operator.
Two matrices A and B are said to be same if Aij = Bij for 0<=i,j<=n-1.
Create a class Product with <PID, cost, quantity> as member
variables. Create a parameterized constructor to assign default values for
quantity and cost and assign consecutive PID starting from 100. Create a copy
constructor, and a destructor, findMaxProduct()as a friend function that
takes an array of N Products as parameter and returns the product with
maximum quantity, getProduct() to read quantity and cost details,
printProduct() to print product details, as member functions. In main()
create an array of Product objects and call findMaxProduct()appropriately
and print the details of the product with maximum quantity.
Assume the following declarations
const int NUMROWS = 3;
const int NUMCOLS = 4;
int val[NUMROWS][NUMCOLS]={8,16,9,52,3,15,27,6,14,25,2,10};
Which statement will change the value of the element with the value 27 to 55.
1. val[0][1] = 55;
2. val[1][2] = 55;
3. val[2][1] = 55;
4. val[1][1] = 55;
LATEST TUTORIALS
APPROVED BY CLIENTS