Constant Real CALORIES_PER_MINUTE = 3.9   // main module Module main() // Local variables Declare Real calories_burned Declare Integer minutes   // Set calories burned For minutes = 10 to 30 step 5   Call setCalories(minutes, calories_burned)

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

// Global constant for calories per minute

Constant Real CALORIES_PER_MINUTE = 3.9

 

// main module

Module main()

// Local variables

Declare Real calories_burned

Declare Integer minutes

 

// Set calories burned

For minutes = 10 to 30 step 5

 

Call setCalories(minutes, calories_burned)

 

// display values

Call showCalories(minutes, calories_burned)

 

End For

 

End Module

 

// The setCalories module calculates number of calories

// from a particular number of minutes.

Module setCalories (Integer minutes, Real Ref calories_burned)

Declare Real fminutes

 

      // some languages require matched type variables for calculations

      // this expression changes an Integer to a Real type

Set fminutes = minutes

 

      // variables are now all of the same type

Set calories_burned = fminutes * CALORIES_PER_MINUTE

 

End Module

 

// The showCalories module accepts minutes and calories burned

// as arguments and displays amounts

Module showCalories (Integer minutes, Real calories_burned)

Display "In minutes: ", minutes

Display "Calories burned: ", calories_burned

End Module

I want flowchart for this please 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning