• API
• FAQ
• Tools
• Trends
• Archive
SHARE
TWEET

# Untitled

a guest Oct 5th, 2010 253 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
2. CS 1411 COMPUTER PROGRAMMING I
3. Assignment No. 2
4. Instructor: Dr. Jinan FIAIDHI
5.
6. 1. Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12…, and Z for 35.
7.
8. 2. 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.
9.
10. 3. Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result.(For division, if the denominator is zero, output and appropriate message.) Some sample outputs follow:
11. 3+4=7
12. 13*5=65
13.
14. 4. A bank in your town updates its t customer's 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:
15.
16. a) Savings accounts receive 4% interest.
17. b) Checking accounts with balances up to \$5,000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
18.
19. 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 appropriate message . Test your program by running five times, using the following data:
20.
21. 46728 S 1000 2700
22. 87324 C 1500 7689
23. 79873 S 1000 800
24. 89832 C 2000 3000
25. 98322 C 1000 750.
26. 5. Write a program that calculates and prints the bill for a cellular telephone company. The 2 types of services: regular and premium. Rates vary based on the type of service and are computed as follows:
27.
28. Regular service:        \$10 plus first 50 minutes are free. Charges for over 50 minutes are \$.20 per minute.
29.