Pennies for Pay Write a Flowgorithm program that calculates how much money someone will earn over a period of time under the following conditions: paid one penny the first day, paid two pennies the second day, paid four pennies the third day and pay continues to double each day. Use nested loops to accomplish the following:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 31PE
icon
Related questions
Question

Pennies for Pay

Write a Flowgorithm program that calculates how much money someone will earn over a period of time under the following conditions:

  • paid one penny the first day,
  • paid two pennies the second day,
  • paid four pennies the third day and
  • pay continues to double each day.

Use nested loops to accomplish the following:

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

What I was asking is was the flowgorithm showed on the main function, not the other functions (getDays, doublepennies, showSalary) . I am actually asking how you guys do the other functions for the code to run ? Please see the attached for a better under

2:47
Program 4 Eight Step Problem So...
Program 4 Eight Step Problem Solving Solution
0. Problem Statement for Pennies for Pay:
Design a program that calculates the amount of money a person would earn over a period of time if
his or her salary (pay) is one penny the first day, two pennies the second day, and continues to
double each day. The program should ask the user for the number of days. Display a table showing
what the salary was for each day, and then show the total pay at the end of the period. All output
should be displayed in a dollar amount, not the number of pennies.
1. Major Task List (Keep it abstract; focus on the "what" high level)
a. Determine each day's salary and total salary
b. Display results
2. Structure Chart (Your blue print plan for your functions... who calls who)
getdays double Pennies showSalary
3. Word Analysis: (Which nouns suggest a need for memory (a variable) and which
verbs suggest a need for action (a function maybe).
main
Problem Statement for Pennies for Pay:
Design a program that calculates the amount of money a person would earn over a period of time
if his or her salary is one penny the first day, two pennies the second day, and continues to
double each day. The program should ask the user for the number of days. Display_a table
showing what the salary_was for each day, and then show the total pay at the end of the period.
The output should be displayed in a dollar amount, not the number of pennies.
Nouns:
Verbs:
Program
Amount of money
Person
Period of time
Salary
Penny
Day
User
Number of days
Table
Total pay
Period
Dollar amount
Number of pennies
a.
Function
main
getDays
design
days
pennies
calculates
Global Constants:
Constant real PENNIES_TO_DOLLARS_FACTOR = 100 (may change this if your desire
alternate conversion method)
days
5GE
earn
is
ask
display
4 Variable Chart: (Conversion of verbs into camelCase variable names).
(May need additional variables)
Input Interim Output
show
Dashboard Calendar
10
To Do
Notifications Inbox
Transcribed Image Text:2:47 Program 4 Eight Step Problem So... Program 4 Eight Step Problem Solving Solution 0. Problem Statement for Pennies for Pay: Design a program that calculates the amount of money a person would earn over a period of time if his or her salary (pay) is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, and then show the total pay at the end of the period. All output should be displayed in a dollar amount, not the number of pennies. 1. Major Task List (Keep it abstract; focus on the "what" high level) a. Determine each day's salary and total salary b. Display results 2. Structure Chart (Your blue print plan for your functions... who calls who) getdays double Pennies showSalary 3. Word Analysis: (Which nouns suggest a need for memory (a variable) and which verbs suggest a need for action (a function maybe). main Problem Statement for Pennies for Pay: Design a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display_a table showing what the salary_was for each day, and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the number of pennies. Nouns: Verbs: Program Amount of money Person Period of time Salary Penny Day User Number of days Table Total pay Period Dollar amount Number of pennies a. Function main getDays design days pennies calculates Global Constants: Constant real PENNIES_TO_DOLLARS_FACTOR = 100 (may change this if your desire alternate conversion method) days 5GE earn is ask display 4 Variable Chart: (Conversion of verbs into camelCase variable names). (May need additional variables) Input Interim Output show Dashboard Calendar 10 To Do Notifications Inbox
2:47
Program 4 Eight Step Problem So...
2. Structure Chart (Your blue print plan for your functions...who calls who)
getdays doublePennies showSalary
3. Word Analysis: (Which nouns suggest a need for memory (a variable) and which
verbs suggest a need for action (a function maybe).
Problem Statement for Pennies for Pay:
Design a program that calculates the amount of money a person would earn over a period of time
if his or her salary is one penny the first day, two pennies the second day, and continues to
double each day. The program should ask the user for the number of days. Display_a table
showing what the salary_was for each day, and then show the total pay at the end of the period.
The output should be displayed in a dollar amount, not the number of pennies.
Nouns:
Verbs:
Program
Amount of money
Person
Period of time
Salary
Penny
Day
User
main
Number of days
Table
Total pay
Period
Dollar amount
Number of pennies
a.
Function
main
getDays
doublePennies
Global Constants:
Constant real PENNIES_TO_DOLLARS_FACTOR
alternate conversion method)
showSalary
days
pennies
days counter
pennies
days
pennies
4 Variable Chart: (Conversion of verbs into camelCase variable names).
(May need additional variables)
Input Interim Output
days
design
pennies
calculates
?
earn
ᎥᎦ
ask
display
show
.5G E
=
Dashboard Calendar
10
To Do
100 (may change this if your desire
Notifications Inbox
Transcribed Image Text:2:47 Program 4 Eight Step Problem So... 2. Structure Chart (Your blue print plan for your functions...who calls who) getdays doublePennies showSalary 3. Word Analysis: (Which nouns suggest a need for memory (a variable) and which verbs suggest a need for action (a function maybe). Problem Statement for Pennies for Pay: Design a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display_a table showing what the salary_was for each day, and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the number of pennies. Nouns: Verbs: Program Amount of money Person Period of time Salary Penny Day User main Number of days Table Total pay Period Dollar amount Number of pennies a. Function main getDays doublePennies Global Constants: Constant real PENNIES_TO_DOLLARS_FACTOR alternate conversion method) showSalary days pennies days counter pennies days pennies 4 Variable Chart: (Conversion of verbs into camelCase variable names). (May need additional variables) Input Interim Output days design pennies calculates ? earn ᎥᎦ ask display show .5G E = Dashboard Calendar 10 To Do 100 (may change this if your desire Notifications Inbox
Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Hello, can you provide the functions for the solution please? 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Types of Loop
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr