Exercise 2A: Variables, Operations, and
User Input
File Name: Exer2A_<Last 4 digits of Badge>
1. Write a program that asks the user for two integers a and b and does the following operations:
Sample Output:
2. Write a program that reads two integers and calculates the square of the sum of two float numbers
and then prints the squared sum displayed in two decimal places.
Sample Output:
3. Write a program that asks the user for the number of items sold and the price per item and calculates
and prints the total cost in two decimal places.
Sample Output:
4. Assume that a CPP student has taken the typing tests 3 times. Ask the student to enter his/her scores
and read the scores. Calculate and print the student average score.
1
5. Write a program that reads a number of items produced by a clothing manufacturer, calculates and
prints the number of dozens of the item and the remaining number of items.
Sample Output:
6. Write a program that asks for an integer between 100(inclusive) and 999(inclusive) but returns the
number with the digits in reverse.