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;
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]
Write a python script that checks if integer numbers between 1 and an integer input from a user are prime numbers (Hint: use the range function to loop between 0 and an integer input).
In a case where prime numbers are identified then add all prime numbers to a new list and display the list, in case where a number is not a prime number display an error message.
Write a program to print the area of a rectangle by creating a class named 'Area' having two functions. First function named as 'setDim' takes the length and breadth of the rectangle as parameters and the second function named as 'getArea' returns the area of the rectangle. Length and breadth of the rectangle are entered through keyboard.( For C sharp with easy code)
Write a program to print the area of two rectangles having sides (4,5) and (5,8) respectively by creating a class named 'Rectangle' with a function named 'Area' which returns the area. Length and breadth are passed as parameters to its constructor.( For C sharp with easy code)
Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5 units by creating a class named 'Triangle' with the constructor having the three sides as its parameters.( For C sharp with easy code)
1. Write a program that asks the user for a height in inches and prints out how many feet and inches that is. There are 12 inches in one foot. For instance, 40 inches is 3 feet and 4 inches. [Hint: use the // operator and the % operator to get each part.]