Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the following pseudocode to be placed in the below hand trace chart please! 1 Module main () // Declare variables below 1.1 Declare

I need the following pseudocode to be placed in the below hand trace chart please!

1 Module main ()

// Declare variables below

1.1 Declare Integer totalBottles = 0

1.2 Declare Integer todayBottles = 0

1.3 Declare string keepGoing = y

// Loop to run program again

1.4 While keepGoing == y

// Call functions

1.5 getBottles (totalBottles, todayBottles, counter)

1.6 calcPayout (totalPayout, totalBottles)

1.7 printInfo (totalBottles, totalPayout)

1.8 Display Do you want to run the program again? (Enter y for yes).

1.9 Input keepGoing

1.10 End While

1.11 End Module

In the pseudocode below, write the missing lines, including:

The missing parameter list

The missing condition (Hint: should run seven iterations)

The missing input variable

The add to the total

The increment statement for the counter

//getBottles module

Module getBottles(Integer totalBottles, Integer todayBottles, Integer counter)

1.5.2 Integer todaysBottles

1.5.3 Integer counter = 1

1.5.4 While _______________________________

1.5.5 Display Enter number of bottles returned for the day:

1.5.6 Input todayBottles

1.5.7 totalBottles = totalBottles + todayBottles

1.5.8 counter = counter + 1

1.5.9 End While

1.5.10 End Module

In the pseudocode below, write the missing lines, including:

The missing parameter list

The missing calculation

//getBottles module

1.6.1 Module calcPayout(totalPayout, totalBottles)

1.6.2 totalPayout = 0 //resets to 0 for multiple runs

1.6.3 totalBottles * .10

1.6.4 End Module

In the pseudocode below, write the missing lines, including:

The missing parameter list

The missing display statement

The missing display statement

//printInfo module

1.7.1 Module printInfo(totalBottles, totalPayout)

1.7.2 Print Your total number of bottles is +totalBottles

1.7.3 Print Your payout is +totalPayout

1.7.4 End Module

c. PUT HAND TRACE CHART HERE [2 points] (Your Hand Trace Chart should include a column for each of the variables defined in the pseudo code and a row for each line of code. Include an additional column to show output that is displayed to the user. Enter the values 1 , 2, 3, 4, 5, 6, 7 for the bottles entered. Enter y to run the program again. Enter the values 10, 20, 30, 40, 50, 60, 70 for the bottles. Enter n to end the program.

Statement #

total

Bottles

total

Payout

keep

Going

counter

todays

Bottles

display

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions