Create a class named ‘CalculateArea’ to calculate the area of three different diagrams i.e. Rectangle, Triangle and a Square using function overloading.
First prompt the user to select the diagram for which he wants the area:
Press 1 for Rectangle
Press 2 for Triangle
Press 3 for Square
After the selected option, call the respective function of the selected diagram and print the area.
Area of rectangle: length*width;
Area of triangle: ½(base*height);
Area of square: (length)2
Write a program that creates a class called student. The data members of the class are name and age.
· Create a nullary constructor and initialize the class object.
· Create a parameterized constructor that can set the values being passed from the main function.
· Create a display function called showall( ) which will be used to show values that have been set.
Use the default copy constructor to show that copying of simple objects can be accomplished through the use of the default copy constructor.
a) How many three-digit numbers can be formed from the digits 0, 1, 2, 3, 4, 5, and 6 if each digit
can be used only once? (05)
(b) How many of these are odd numbers? (05)
(c) How many are greater than 330?
Write a Python program that accepts a string and calculate thenumber of digits and letters
Sample Data : Python 3.9
Expected Output :
Letters 6
Digits 2
Write a Python program to convert temperatures to and from celsius, fahrenheit.
[ Formula : c/5 = f-32/9 [ where c = temperature in celsius and f = temperature in fahrenheit ]
Expected
Output :
60°C is 140 in Fahrenheit
45°F is 7 in Celsius
Get the input from the user for the number of rows and columns.
Print 0 in the row one.
Print 1 in the row two.
Case= Test 1
input=
5
5
output=
00000
11111
00000
11111
00000
Write a C++ program to enter salary and output income tax and net salary using multiple inheritance concept.
Note: Use Linked List to implement stack.
A stack is an object that allows the following operations:
Push: Add an element to the top of a stack
Pop: Remove an element from the top of a stack
IsEmpty: Check if the stack is empty
Peek: Get the value of the top element without removing it
Create a class to define above mention operations of stack along with some addition functionality:
i. Copy a stack to another one.
ii. Delete an element at a specified location.
iii. Returns the count of elements in a stack.
iv. Insert an element at a specified location.
Write a main function to test the functionality of above class.
Remember: To access any element that is not at top, you have to first pop all other elements on the top of that.
Note: Use Linked List to implement stack.
Solve for what is asked in the following problem, show your complete solution
Student A investigated the rate of reaction between calcium carbonate (marble chips) and hydrochloric acid. The student collected 10.0 cm3 of gas produced after 15 seconds.Student B investigated the rate of reaction between magnesium and hydrochloric acid. The student collected 19.5 cm3 of gas produced after 10 seconds.Which student’s investigation had a faster rate of reaction?
A refrigerator unit working on Bell Coleman cycle takes air from cold chamber at -10 °C and compresses it from 1 bar to 6.5 bar with index of compression being 1.2. The compressed air is cooled to a temperature of 25 °C before it is expanded in the expander where the index of expansion is 1.35, determine,
a. COP
b. Quantity of air circulated per minute for production of 2000 kg of ice per day at 0 °C from water at 20 °C
c. Capacity of the plant in tons of refrigeration Assume, C₂ = 1 kJ/kg k for air.