Programming Questions and Exercises : Input Output

Programming Questions and Exercises : Input Output

Question 1.
Area of RectangleWrite a program that asks the user to enter length and width of a rectangle. The program should compute and display the area of rectangle.

Question 2.
Area of TriangleIf a triangle has side lengths a,b,c, then the formula for the area of the triangle is area = √s(s − a)(s − b)(s − c), where s = (a + b + c)/2.
Write a program that asks the user to enter three sides of triangle. The program should compute and display the area of triangle.

Question 3.
Celsius to FahrenheitWrite a program that asks for a temperature in Celsius and prints out the temperature in Fahrenheit. Use InputBox for input and OutputBox for output. The formula to convert Celsius to the equivalent Fahrenheit is:
fahrenheit = 1.8 x celsius + 32

Question 4.
Wall Painting Calculator
Write a program that when complete will calculate the amount of paint needed to paint the walls and the ceiling of a room. Your program should ask lenght, width, and height of room. Assume that the room has doors and windows the don't need painting. Also the floor in the room is not painted. Ask the user to enter the number of doors and number of windows in the room, and adjust the total square feet to be painted accordingly. Assume that each door is 20 square feet and each window is 15 square feet.
Suppose the paint covers 350 square feet per gallon.

Question 5.
PigLatin WordWrite a program that reads a word as input and converts that word to "Pig Latin". In this version of Pig Latin, you convert a word by removing the first letter, placing that letter at the end of the word, and then appending "ay" to the word. Here is an example:
English : night
Latin: ightnay

Question 6.
Loan CalculatorWrite a loan calculator program that computes monthly payment for a given loan amount, annual interest rate, and loan period.
Equations required to calculate the monthly payment :
monthly payment = (L*R)/( 1 - (1/(1-R)^n)
L = amount of the loan
R = monthly interest rate
n = number of months the loan is paid

Question 7.
Hours, Minutes and SecondsWrite a program that asks the user to enter seconds as integer. The program should compute and display the number of hours, number of minutes and number of seconds in that seconds.
For example if user enters 4205 seconds. The answer should be
Hours : 7
Minutes : 10
Seconds : 5

No comments:

Post a Comment

Pages