Insert, into the first stack, all the data above (which is the data of student’s names,
surnames and the marks they obtain in a particular assessment)
Display the content of the stack on the screen (console)
Then, remove all the students whose surname starts with the alphabets ‘R’, ‘J’ and
‘M’, from the first stack and insert them into the second Stack.Display the contents of Stack1 and Stack2. Finally, remove all the students whose marks are less than 50 from both Stack1 and Stack2 and insert them into the Third Stack. Display the contents of all the 3 Stacks. (30) 3b. Sort all the stacks in this order: Stack1 in alphabetic order by name Stack2 in alphabetic order by Surname Stack3 in Numeric order (descending) by marks obtainedSam Williams 60 2. John Phoenix 85 3. Simon Johnson 75 4. Sarah Khosa 81 5. Mat Jackson 38 6. Nick Roberts 26 7. Isaac Wayne 74 8. Anna Mishima
34 9. Daniel Rose 64 10. Aaron Black 83 11. Jack Mohamed 27 12. Kathrine Bruckner 4
For a given radius of a circle, calculate the area and print the size accordingly:
Size area
Size closed
Small 0-20
Medium 21-50
Large 50+
Write a pseudo code of a program that calculates and outputs how much a products
price has increased or decreased in percentage. If the new price is more than the original price, output
“Increased”, similarly If the new prince is less then original price output “decreased”.
ID
1
2
3
4
Original Price
4950
995521
56702
95040
New Price
7890
447984
28351
19008
Your output should have this format
ID X percent Increase
ID X percent decreased
Example
ID:5 65 percent Increased
ID:6 40 percent decreased
Since you are now a computer science student everyone believes you can solve problems
that are not easily solved by common people. One day your father calls you and say’s I have no idea why
our electricity bill is too high. He aspects you to solve the question luckily you know your electric supply
company calculates the electricity bill according to per unit rate which depends on how many units you
consumed. You have to write the pseudo code to calculate the electricity bill according to the following
criteria.
Criteria: For the first 100 units rate is 5.Rs per unit. For every next 100 units rate increased by 2.Rs
from previous one e.g 101 to 200 units have 7.Rs per unit rate.
You are given n number of different numbers. Write the pseudo code to identify the number
whose value is in between the other numbers.
Example:
Lets suppose input numbers are:2,13,5
Output:5
write the pseudo-code, flowcharts and code of program in which You have to take the temperature in Celsius from the user and convert it to Fahrenheit.
If the converted temperature is odd, print the temperature in Fahrenheit. If the converted temperature is
even, covert the Fahrenheit temperature to Kelvin and display it on the screen
A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or lowercase): A, B, or C. Employees in departments A and B are receiving a 2% raise. Employees in department C are receiving a 1.5% raise. Write the C++ code to calculate and display the appropriate raise amount. Display the raise amount in fixed-point notation with two decimal places.
Q1. Consider the code given below.
How many times the following are invoked:
I) Default constructor
II) Parameterized constructor
III) Copy constructor
IV) Destructor
class test
{ int a;
public:
test(){a=0;}
test(int x) {a=x;}
test(const test &T){a=T.a;}
~test(){ }
test add(test X)
{ test T;
T.a=a+X.a;
return 0;
}
};
int main()
{ test t1(5),t2(10),t3;
t3=t1.add(t2);
return 0;
}
[Assume all the header files and namespaces included.]
Write a program that will output the square root of any number entered through the keyboard, until the inputted number, is zero.
Create a class called ‘Student’ holding the basic information about the student including the roll.no and name.
Derive a class called ‘Academics’ from the student with the protected members for accessing three different subject marks.
Derive another class from Student called ‘Extracurricular’ with the sports mark.
Now compute the result marks(average of academics + sports marks) creating a class result inheriting academics and extracurricular