004-002-003
Array Creation: Price List
Easy
Problem Description
array Creation: Price List
In this problem, you will create a program that stores three product prices in an integer array, displays each element with its index, and calculates the total to display to standard output.
Learning Objective: Learn how to create arrays with initial values
Create a program that inputs three product prices, stores them in an array, and calculates the total.
Input
Line 1: Price 1 (integer)
Line 2: Price 2 (integer)
Line 3: Price 3 (integer)
Output
Price 0: [price1]
Price 1: [price2]
Price 2: [price3]
Total: [total]
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