A student visited an electronics and book store to purchase a laptop for online classes, a mobile phone for communication, and a book for studies. The shopkeeper asked the student to calculate the total amount spent on all three items and also find the average price of the purchased products. Write a program that takes the prices of the laptop, mobile phone, and book as input from the user, calculates the total price and average price, and displays the results on the screen.
Rajesh appeared in three subjects in his school examination: Physics, Chemistry, and Mathematics. After the exams, he wanted to calculate his overall performance by finding the total marks obtained and the percentage scored. Write a program that takes the marks of Physics, Chemistry, and Mathematics as input from the user, calculates the total marks and percentage, and displays the results on the screen.
A water tank manufacturing company produces cylindrical tanks of different sizes. To know how much water a tank can store, the company needs to calculate the volume of the cylinder. Write a program that takes the radius and height of the cylinder as input from the user and calculates the volume using the formula:
vol=3.14×r×r×h/3
Display the calculated volume on the screen.
An ice cream factory manufactures cone-shaped containers for packing ice cream. To determine how much ice cream each cone can hold, the factory needs to calculate the volume of the cone. Write a program that takes the radius and height of the cone as input from the user and calculates the volume using the formula:
V=3.14×r×r×h/3
Display the calculated volume on the screen.
A construction company is designing different types of playgrounds and decorative areas. Some areas are square-shaped while others are circular in shape. To estimate the required materials, the company needs to calculate the area of both shapes. Write a program that takes the side of the square and the radius of the circle as input from the user, calculates the area of the square and the area of the circle using the given formulas, and displays the results on the screen.
The weather department recorded the temperature of a city in Fahrenheit degrees and wanted to convert it into Centigrade (Celsius) degrees for better understanding. Write a program that takes the temperature in Fahrenheit as input from the user and converts it into Centigrade using the appropriate formula. Display the converted temperature on the screen.
c=(f-32)*5/9
Two numbers are stored in two different memory locations named C and D in a computer system. The programmer wants to exchange the values stored in these two locations so that the value of C becomes the value of D and the value of D becomes the value of C. Write a program that takes two numbers as input from the user, stores them in C and D, interchanges their contents, and displays the values after swapping.
A bus travel company records the journey time of buses only in minutes. However, passengers find it easier to understand the time in hours and minutes format. Write a program that takes the total time in minutes as input from the user and converts it into valid hours and remaining minutes. Finally, display the converted time in proper hour and minute format.
A digital lock system uses a five-digit PIN code for authentication. To perform a special security check, the system needs to calculate the sum of all the digits entered in the PIN. Write a program that accepts a five-digit number from the user, finds the sum of its digits, and displays the result on the screen.
A treasure hunt game uses a five-digit secret code to unlock the next level. The code entered by the player must be processed digit by digit so that the digits appear from the last position to the first position on the screen. A five-digit number is input through the keyboard and the processed result is displayed.
A railway ticket system generates a unique six-digit ticket number for every passenger. For a quick verification process, the system checks only the first and the last digit of the ticket number and combines their values. A six-digit number is entered through the keyboard, and the required result is displayed on the screen.