Prince would pass a beggar in the streets

Assignment Help Basic Computer Science
Reference no: EM13707530

Can someone assist me with the program code for this assignment?

There is a legend that claims that everyday a Prince would pass a  beggar in the streets. One day the Prince offered to give the beggar  a million dollars that day, or a penny that day and double it every day  for a month. The beggar accepted the latter. Calculate the total amount  the Prince would have given the beggar after 30 days. ALSO: Display a  message each day with the day number and the amount paid that day.
ALSO: display a message stating the day that the total surpassed $1 million.  Finally, display a message stating the overall total for the entire 30 days.

Here is the expected output; your program has to do this properly, do not just replicate the output!

day 1: 1 pennies.
day 2: 2 pennies.
day 3: 4 pennies.
day 4: 8 pennies.
day 5: 16 pennies.
day 6: 32 pennies.
day 7: 64 pennies.
day 8: 128 pennies.
day 9: 256 pennies.
day 10: 512 pennies.
day 11: 1024 pennies.
day 12: 2048 pennies.
day 13: 4096 pennies.
day 14: 8192 pennies.
day 15: 16384 pennies.
day 16: 32768 pennies.
day 17: 65536 pennies.
day 18: 131072 pennies.
day 19: 262144 pennies.
day 20: 524288 pennies.
day 21: 1048576 pennies.
day 22: 2097152 pennies.
day 23: 4194304 pennies.
day 24: 8388608 pennies.
day 25: 16777216 pennies.
day 26: 33554432 pennies.
day 27: 67108864 pennies. * MILLION DOLLAR MARK!
day 28: 134217728 pennies.
day 29: 268435456 pennies.
day 30: 536870912 pennies.

Total amount paid: 1073741824 pennies

NOTE: DO NOT USE GLOBAL VARIABLES!!!!!
A global variable is a variable that is defined outside of any function (including main). We don't cover them in this course because they are generally a very bad idea. So, don't do this in your projects!

Reference no: EM13707530

Questions Cloud

What is the speed of the car at the end of that time : A car accelerates from rest at a constant rate of 2.4m/s2 for 5.0s. What is the speed of the car at the end of that time
Dna rights-who owns your genetic code : Research the history, examples, causes, impacts ancftthical issues surrounding the subject. Be sure to understand the arguments being used by all parties. There may be more than 2 sides of the issue.
What horizontal force is required to move the box : A 6.27kg box sits on a ramp that is inclined at 37.0 degrees above the horizontal. The coefficient of kinetic friction between the box and the ramp is 0.30. What horizontal force is required to move the box
Find her average speed in meters per second : A senior citizen walks 0.40km in 12min , going around a shopping mall. What is her average speed in meters per second
Prince would pass a beggar in the streets : There is a legend that claims that everyday a Prince would pass a  beggar in the streets. One day the Prince offered to give the beggar  a million dollars that day, or a penny that day and double it every day  for a month. The beggar accepted the ..
Cloud computing : Select two (2) organizations in which you are interested, and use the Internet and Strayer Library to research the advantages and disadvantages of cloud computing for the selected organizations. Use the Internet to research the characteristics ..
Find at what angle should the player aim the ball : A basketball player is 15 ft horizontally from the center of the basket, which is 10 off the ground. At what angle should the player aim the ball if it is thrown from a height of 8.2 ft with a speed of 28 ft/s
Calculate the terminal velocity for a pollen grain : Calculate the terminal velocity for a pollen grain falling through the air using the drag force equation. Assume the pollen grain has a diameter of 2 µm and a density of 0.4 g/cm3
Develop a logical design for this enterprise campus : Develop a logical design for this enterprise campus that considers the seven network architecture components. There are no other campuses, so you can omit WAN access. You will need to make some assumptions, so be sure to document your assumptions ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd