Question: LAB 3: SIMPLE PROGRAMS II Write C++ programs on 1. Convert the time in seconds to hours, minutes and seconds [1 hr =3600 sec) For
LAB 3: SIMPLE PROGRAMS II Write C++ programs on 1. Convert the time in seconds to hours, minutes and seconds [1 hr =3600 sec) For E.g: 4680 seconds Answer: 1hr 18 minutes 0 seconds 2. Convert distance in mm to cm, inch, and feet. The input is distance in mm. The output is to print the distance in centimeters, then in inch and after that in feets. The following conversions can be used. [1 cm =10mm, linch=2.5cm, 1 feet =12 inches] 3. To input P, N and R and Compute simple and compound interest [Hint: SI = PNR/100, CI =P (1+R/100) N - P] 4. To find the sum of the digits of a four-digit number (Eg: N = 1234, then sum=10] - without looping s. To determine how much money in rupees) is in a piggy bank that contains denominations of Rs. 20, Rs. 10, 5 rupee and some 50 paisa coins. Use the following values to test your program: 13 twenty rupee notes, 11 ten rupee notes, 7 five rupee coins and 13 fifty paisa coins. (Hint: answer is Rs.411.5] 6. Write a program to calculate the mass of air in an automobile tire. [Hint: PV=0.37m (T+460) where P = pressure, pounds per square inch (psi), V = volume, cubic feet, m= mass of air, pounds, T = temperature, degrees Fahrenheit] The tire contains 2 cubic feet of air. Assume that the pressure is 32 psi at room temperature
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
