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

Write a program to take input for n number of doctor records and write records of all cardiologists in a file named: “record1”. Also write records of all those doctors in another file named: “record2” who are taking salary more than INR 80,000. After writing records in both files, merge their contents in another file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of doctor: doc_id, doc_name, doc_specialization, doc_salary]

A timetable for the consultation of a member of the parliament is organized, in which citizens are registered, with their name, surname, and age. Consultation provided by a member of the parliament takes ~10 minutes. Therefore the duration of the consultation must be indicated in the registration, and however, it can be shorter and also longer. If the length of consultation of a new citizen is 70% shorter comparing to the duration of a citizen standing before him,

 

The program must have the following features:

 

1)   Register a new citizen for consultations;

2)   Print the list of consultations (details of all waiting citizens) by providing summary information on the total duration and number of consultations;

3)   Cancel longer than specified duration (entered by the operator) consultations;

4)   Apologize to all citizens and cancel all consultations;

 

* A member of the parliament may only hold consultations for 2 hours per day.


ewrite the following C++ code in pseudocode. (5)

for (int x = 1; x <= 10; x++) {

for (int y = 10; y >= x; y--) {

if (y % 2 == 0) {

cout << "*";

}

else {

cout << "#";

}

}

cout << endl;


BTTP needs an application to help them calculate the cost of paving. Enter the size of 

the area to be paved in square meters as well as the cost of paving per square meter. 

3.1. Write a pseudocode as shown in the table below. (10)

BTTPApp

NO METHOD NAME DESCRIPTION MARK

1 main This function displays the results by calling 

the required methods.

6

2 calculatePavingCost This function calculates the cost of paving

as explained in the problem statement.

4

3.2. Convert the pseudocode solution for Question 3.1 into a C++ program.


Write a C++ program for a lecturer to convert all his (5 students) student marks to 

a percentage. Enter the total mark of the test, and then enter for each student his 

student number, and the mark obtained by the student. Display the student number, 

percentage, and status indicating whether the student passed (50% or more) or failed 

the test.

Include the following function and sub procedures (as shown in the table below):

LectureApp

NO METHOD NAME DESCRIPTION MARK

1 main This function prompts for the total and 

also invokes the required procedures to 

display the results.

7

2 getData This sub procedure prompts for the 

student number and mark obtained by the 

student from the end-user.

4

3 determinePercentage This function returns the mark obtained in

percentage.

4

4 determineStatus This function returns true if the student 

passed or false, otherwise.

6

5 printOutput This sub procedure displays the output as 

shown in the sample output.

4


for (int i = 1; i <= 100; i++)


{


for (int j = 2; j < i; j++)


{


if (i % j == 0)


{


bcd++;


break;


}


}


if (bcd == 0 && i != 1)


{


cout << i << endl;


}


bcd = 0;


}

Write a program to overload operators in the same program by writing suitable operator member functions for following expression:



07= ((01 % 02)>(03 || 04) - (05>06)) [Here 01,02,03,04,05,06 and 07 are objects of a class "overloading", and this class is having one integer data member]


Write a program to take input for n number of doctor records and write records of all cardiologists in


a file named: “record1”. Also write records of all those doctors in another file named: “record2” who are


taking salary more than INR 80,000. After writing records in both files, merge their contents in another


file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of doctor:


doc_id, doc_name, doc_specialization, doc_salary]

Q2: Write a program to overload operators in the same program by writing suitable operator member

functions for following expression:

07= ((01 % 02)>(03 || 04) - (05>06)) [Here 01,02,03,04,05,06 and 07 are objects of a class

"overloading", and this class is having one integer data member]


Q4: Discuss constructors with default arguments and constructor overloading with the help of suitable

examples.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS