0% found this document useful (0 votes)
26 views2 pages

User Input and Average Calculation Program

The document outlines a series of programming exercises focused on variables, operations, and user input. It includes tasks such as performing arithmetic operations on integers, calculating the square of sums, determining total costs, averaging scores, and manipulating numbers. Each exercise requires specific outputs and user interactions, emphasizing practical coding skills.

Uploaded by

shilbe Gemaing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

User Input and Average Calculation Program

The document outlines a series of programming exercises focused on variables, operations, and user input. It includes tasks such as performing arithmetic operations on integers, calculating the square of sums, determining total costs, averaging scores, and manipulating numbers. Each exercise requires specific outputs and user interactions, emphasizing practical coding skills.

Uploaded by

shilbe Gemaing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like