003-004-006
Compound Assignment: Point Update
Easy
Problem Description
Compound Assignment: Point Update
In this problem, you will create a program that reads current points and earned points from standard input, calculates the total using the compound assignment operator (+=), and displays the result to standard output.
Learning Objective: Learn to update variables efficiently using compound assignment operators (+=)
Manage point card points. Add new points to current points and display the total.
Input
Line 1: Current points (integer)
Line 2: Earned points (integer)
Output
Current: [points1] pt
Earned: [points2] pt
Total: [points1+points2] pt
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up