Lab 04
Lab 04
PROGRAMMING FUNDAMENTALS
Lab 04: Use of Conditional statements
1: Write C++ program, ask to the user to enter a character to check whether it is an alphabet or
not,then display the output on the screen:
2: Write a program that prompts the user to input a number. The program should then output the
number and a message saying whether the number is positive, negative.
3: Write a program that prompts the user to input three numbers. The program should then
output the numbers in ascending order.
4: In a right triangle, the square of the length of one side is equal to the sum of the squares of the
lengths of the other two sides. Write a program that prompts the user to enter the lengths of
three sides of a triangle and then outputs a message indicating whether the triangle is a right
triangle.
5: A bank in your town updates its customers’ accounts at the end of each month. The bank offers
two types of accounts: savings and checking. Every customer must maintain a minimum balance.
If a customer’s balance falls below the minimum balance, there is a service charge of $10.00 for
savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at
least the minimum balance, the account receives interest as follows:
Write a program that reads a customer’s account number (int type), account type (char; s for
savings, c for checking), minimum balance that the account should maintain, and current balance.
The program should then output the account number, account type, current balance, and an
appropriate message. Test your program by running it five times, using the following data:
…END…