Question

In: Computer Science

Write the Flowchart for the following programming problem based on the pseudocode below. Last year, a...

Write the Flowchart for the following programming problem based on the pseudocode below.

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 as follows:

notGreenCost = [0] * 12

goneGreenCost = [0] * 12

savings = [0] * 12

months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']

   

Your sample output might look as follows:

Enter NOT GREEN energy costs for January

Enter now -->789

Enter NOT GREEN energy costs for February

Enter now -->790

Enter NOT GREEN energy costs for March

Enter now -->890

Enter NOT GREEN energy costs for April

Enter now -->773

Enter NOT GREEN energy costs for May

Enter now -->723

Enter NOT GREEN energy costs for June

Enter now -->759

Enter NOT GREEN energy costs for July

Enter now -->690

Enter NOT GREEN energy costs for August

Enter now -->681

Enter NOT GREEN energy costs for September

Enter now -->782

Enter NOT GREEN energy costs for October

Enter now -->791

Enter NOT GREEN energy costs for November

Enter now -->898

Enter NOT GREEN energy costs for December

Enter now -->923

-------------------------------------------------

Enter GONE GREEN energy costs for January

Enter now -->546

Enter GONE GREEN energy costs for February

Enter now -->536

Enter GONE GREEN energy costs for March

Enter now -->519

Enter GONE GREEN energy costs for April

Enter now -->493

Enter GONE GREEN energy costs for May

Enter now -->472

Enter GONE GREEN energy costs for June

Enter now -->432

Enter GONE GREEN energy costs for July

Enter now -->347

Enter GONE GREEN energy costs for August

Enter now -->318

Enter GONE GREEN energy costs for September

Enter now -->453

Enter GONE GREEN energy costs for October

Enter now -->489

Enter GONE GREEN energy costs for November

Enter now -->439

Enter GONE GREEN energy costs for December

Enter now -->516

-------------------------------------------------

                        SAVINGS                     

_____________________________________________________

SAVINGS     NOT GREEN     GONE GREEN         MONTH

_____________________________________________________

$ 243          $ 789          $ 546           January

$ 254          $ 790          $ 536           February

$ 371          $ 890          $ 519           March

$ 280          $ 773          $ 493           April

$ 251          $ 723          $ 472           May

$ 327          $ 759          $ 432           June

$ 343          $ 690          $ 347           July

$ 363          $ 681          $ 318           August

$ 329          $ 782          $ 453           September

$ 302         $ 791          $ 489           October

$ 459          $ 898          $ 439           November

$ 407          $ 923          $ 516           December

Do you want to end program? (Enter no or yes): yes

The Pseudocode

Module main()

            //Declare local variables

            Declare endProgram = “no”

            While endProgram == “no”

                        Declare Real notGreenCost[12]

                        Declare Real goneGreenCost[12]

                        Declare Real savings[12]

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

                          //function calls

                        getNotGreen(notGreenCost, months)

                        getGoneGreen(goneGreenCost, months)

                        energySaved(notGreenCost, goneGreenCosts, savings)

                        displayInfo(notGreenCost, goneGreenCosts, savings, months)

           

                        Display “Do you want to end the program? Yes or no”

                        Input endProgram

            End While

End Module

Module getNotGreen(Real notGreenCost[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Enter NOT GREEN energy costs for”, months[counter]

                        Input notGreenCosts[counter]

                        Set counter = counter + 1

            End While       

End Module

Module getGoneGreen(Real goneGreenCost[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Enter GONE GREEN energy costs for”, months[counter]

                        Input goneGreenCosts[counter]

                        Set counter = counter + 1

            End While       

End Module

Module energySaved(Real notGreenCost[], Real goneGreenCost[], Real savings[])

            Set counter = 0

            While counter < 12

                        Set savings[counter] = notGreenCost[counter] – goneGreenCost[counter]

                        Set counter = counter + 1

            End While

End Module

Module displayInfo(Real notGreenCost[], Real goneGreenCost[], Real savings[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Information for”, months[counter]

                        Display “Savings $”, savings[counter]

                        Display “Not Green Costs $”, notGreenCost[counter]

                        Display “Gone Green Costs $”, goneGreenCost[counter]

            End While

End Module

Solutions

Expert Solution

FLOWGARITHMS

MAIN()

DISPLAYINFO()

ENERGYSAVED()

GETNOTGREEN()

GETGONEGREEN()

OUTPUT


Related Solutions

6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user...
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately. For example if the user enters B a b e c o o d i u g o a l $ Then we have the output below: #A=2 #E=1 #I=1 #O=3 #U=2
[15 marks] Draw the flowchart of the following programming problem: You can draw the flowchart using...
[15 marks] Draw the flowchart of the following programming problem: You can draw the flowchart using a drawing tool, or draw the flowchart on a piece of paper, take a picture, insert it here or save it in the submission folder The program reads an unspecified number of integers until a zero is entered. While the program reads each number it counts the number of positive numbers and the number of negative numbers that have been entered and sum up...
Selection/Conditional Structure: Create a flowchart and pseudocode for the problem below: Juan dela Cruz Restaurant is...
Selection/Conditional Structure: Create a flowchart and pseudocode for the problem below: Juan dela Cruz Restaurant is offering a 20% discount to all customers whose last name is also dela Cruz. Input the last name of the customer and the total amount due to the customer and then output the amount to be paid. (C++ Program, choose only the LAST NAME)
Write an algorithm (flowchart OR Pseudocode) for the following problems: Take ten different numbers as input...
Write an algorithm (flowchart OR Pseudocode) for the following problems: Take ten different numbers as input and display the sum of there squares (SS). Example: let the inputs are: 3, 0, -1, 0, 9, -5, 6, 0, 2, 1 then 157 is displayed, because: SS=32+02+(-1)2+02+92+(-5)2+62+02+22+12=157 Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately. For...
In this Java lab, you use the flowchart and pseudocode found in the figure below to...
In this Java lab, you use the flowchart and pseudocode found in the figure below to add code to a partially created Java program. When completed, college admissions officers should be able to use the Java program to determine whether to accept or reject a student, based on his or her test score and class rank. Declare the variables testScoreString and classRankString. Write the interactive input statements to retrieve: A student’s test score (testScoreString) A student's class rank (classRankString) Write...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have someone try to guess it by following your instructions. Submit the flowchart or pseudocode and the results of your test. Create a python program based on your flowchart or pseudocode....
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
For the following problem, draw a flowchart, write a function and then execute the function with...
For the following problem, draw a flowchart, write a function and then execute the function with your choice of input parameter values: For given two input parameters: If parameter 1 is smaller than parameter 2 return the remainder of parameter 1 by parameter 2 Otherwise, return the multiplication of two input parameters. Python programming language
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT