Question

Pennies for pay

Susan is hired for a job, and her employer agrees to pay her every day. Her employer also agrees that Susan’s salary is 1 penny the first day, 2 pennies the second day, 4 pennies the third day, continuing to double each day. Create an app that allows the user to enter the number of days that Susan will work and calculates the total amount of pay she will receive over that period of time.

I don't know why it doesn't work, can you help me check the code below?

( Please don't copy data from another source, I just want to know why my code is not working and how to make it work)

when btnCalculate initialize local NumberOfDays to Click do C initialize local Count to initialize local PenniesCount to 1 1

And the picture below is my design screen included (btnCalculate and txtNumberofDays)

Z 9:48 Screen1 Calculate

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Actually the code run infinite times because you didn't increment the count value.if you didn't increment count value it always 1.

1 always <=given positive input.so it iterate infinite times.so you initialize count =count+1

if count ==positive input it will terminate and gives the output.

so set as count==count+1

PennisCount=2*PenniCount below write this code

count=count+1

it will work fine if you have any doubt comment below..

Add a comment
Know the answer?
Add Answer to:
Pennies for pay Susan is hired for a job, and her employer agrees to pay her...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Ethical Issues “Maria, do you have a minute?" Josey asked the COO after stopping her in...

    Ethical Issues “Maria, do you have a minute?" Josey asked the COO after stopping her in the hall. "If it's quick, I do. I'm on my way to a meeting in a few minutes with the rest of the executive team." "I'll only take a minute. I've been going through the numbers your team gave me about the new line," Josey said as they slipped into an alcove in the lobby, out of the foot traffic of Wedgewood's main offices....

  • Ethical Issues "Maria, do you have a minute?" Josey asked the COO after stopping her in...

    Ethical Issues "Maria, do you have a minute?" Josey asked the COO after stopping her in the hall. "If it's quick, I do. I'm on my way to a meeting in a few minutes with the rest of the executive team." "I'll only take a minute. I've been going through the numbers your team gave me about the new line," Josey said as they slipped into an alcove in the lobby, out of the foot traffic of Wedgewood's main offices....

  • Ethical Issues “Maria, do you have a minute?" Josey asked the COO after stopping her in...

    Ethical Issues “Maria, do you have a minute?" Josey asked the COO after stopping her in the hall. "If it's quick, I do. I'm on my way to a meeting in a few minutes with the rest of the executive team." "I'll only take a minute. I've been going through the numbers your team gave me about the new line," Josey said as they slipped into an alcove in the lobby, out of the foot traffic of Wedgewood's main offices....

  • Layla just got hired as the Web developer for a small business called Axe Grinders, which...

    Layla just got hired as the Web developer for a small business called Axe Grinders, which sells and repairs guitars and amps. The aging rock 'n' rollers who own Axe Grinders were taking care of business by phone and mail, but they just don't have too much time on their hands for this anymore. They decided they need a Web site so they could start processing orders more efficiently, spend their time on guitars, and get the business back in...

  • Question: In Real Life: Paraphrasing on the Job Transcript Activity [ Silence ] >> Jill: Oh, hey, I'm having the...

    Question: In Real Life: Paraphrasing on the Job Transcript Activity [ Silence ] >> Jill: Oh, hey, I'm having the strangest feeling about our boss lately. >> Mark: What's that? >> Jill: Well I'm beginning to think maybe this thing about women, or maybe it's just about me. >> Mark: You think he's coming onto to you. >> Jill: Oh, no not at all. But it seems like he doesn't take women, or me seriously. >> Mark: What do you...

  • Arrange View Share Window Help 7 Ethics Case Study Paper-Edited 125% v T View Zoom Insert...

    Arrange View Share Window Help 7 Ethics Case Study Paper-Edited 125% v T View Zoom Insert Table Chart Text Shape Media Comment Collaborat 2 Ethics Case Study Analyze the following case studies and respond to the questions attached in a short (3-5 page) paper. Post the answers as a Word document via Turnitin by the date indicated on the joule site. Consult the School of Nursing rubric for written assignments found on the joule site for the course. Ethics Case...

  • This year Evan graduated from college and took a job as a deliveryman in the city....

    This year Evan graduated from college and took a job as a deliveryman in the city. Evan was paid a salary of $68,500 and he received $700 in hourly pay for part-time work over the weekends. Evan summarized his expenses below: Cost of moving his possessions to the city (125 miles away) Interest paid on accumulated student loans Cost of purchasing a delivery uniform Contribution to State University deliveryman program $1,200 2,840 1,440 1,320 Calculate Evan's AGI and taxable income...

  • Interpersonal Communication Subject! Advice Column Assignment - Guidelines If you’ve perused a newspaper before, you’re probably...

    Interpersonal Communication Subject! Advice Column Assignment - Guidelines If you’ve perused a newspaper before, you’re probably familiar with the various advice columnists (“Dear Abby” comes to mind) who help out distraught individuals in managing any number of interpersonal crises in his/her life. This assignment is divided into two parts: One where you'll be assuming the role of the letter writer who presents the problem, and another where you'll play the role of the actual advice columnist and respond to letters....

  • 3. Process perspectives on motivation (Connect, Perform) Read the short scenario below. Then use your understanding...

    3. Process perspectives on motivation (Connect, Perform) Read the short scenario below. Then use your understanding of expectancy theory to diagnose the particular employee's barrier to performance Management at Work You are a manager at a company with a written compensation plan that outlines how employees will be paid for performance. When employees get higher annual performance ratings, they will get larger increases in their base pay. Also, when the company achieves certain goals each year, such as hitting earnings...

  • case study, following questions. A Healthy Retirement? Part -"The Cookout" by Ann Henninger Biology Department Wartburg...

    case study, following questions. A Healthy Retirement? Part -"The Cookout" by Ann Henninger Biology Department Wartburg College, Waverly, lowa Late afternoon on a Monday in June "The backyard is ready for tonight's cookout, Jim announced as he entered the kitchen and dropped into a chair. "The tables and chairs are set up, the grill is clean, and the drinks are on ice. Sure glad I cut the grass yesterday. I don't think I would have had time to do that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT