[SOLVED] A program that will allow the user to enter the energy bill

25.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (2 votes)

Last year, a local college implemented rooftop gardens as a way to promote energy efficiency and save money. Write a program that will allow the user to enter the energy bills from January to December for the year prior to going green. Next, allow the user to enter the energy bills from January to December of the past year after going green. The program should calculate the energy difference from the two years and display the two years’ worth of data, along with the savings.

Hints: Create three arrays of size 12 each. The first array will store the first year of energy costs, the second array will store the second year after going green, and the third array will store the difference. Also, create a string array that stores the month names. These variables might be defined in pseudocode as follows:

Declare Real notGreenCost[12] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Declare Real goneGreenCost[12] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Declare Real savings[12] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Declare String months[12] = [“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”]

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.