Program to simulate the vending machine

Assignment Help Basic Computer Science
Reference no: EM131268771

You have invented a vending machine capable of deep frying twinkies. Write a program to simulate the vending machine. It costs $3.50 to buy a deep-fried twinkie, and the machine only takes coins in denominations of a dollar, quarter, dime, or nickel. Write code to simulate a person putting money into the vending machine by repeatedly prompting the user for the next coin to be inserted. Output the total entered so far when each coin is inserted. When $3.50 or more is added, the program should output "Enjoy your deep-fried twinkie" along with any change that should be returned. Use top-down design to determine appropriate functions for the program.

Reference no: EM131268771

Questions Cloud

What role does the erd play in the design process : What role does the ERD play in the design process? What is a weak entity? What is a composite entity, and when is it used? Provide examples of a weak entity and composite entity.
Budget enforcement act : What loophole in the Budget Enforcement Act of 1990 was used to pass both the bailout package for the airline industry and the Job Creation and Worker Assistance Act of 2002?
Average rate of change function : The Average Rate of Change function describes the average rate at which one quantity is changing with respect to something else changing. Give an example of an everyday average rate of change calculations. Discuss how knowing this information help..
Write an assembly program to compute the fibonacci sequence : Write an assembly program to compute the Fibonacci sequence for the first 10 values of the sequence and store these values into the data memory beginning with the first memory location.
Program to simulate the vending machine : You have invented a vending machine capable of deep frying twinkies. Write a program to simulate the vending machine. It costs $3.50 to buy a deep-fried twinkie, and the machine only takes coins in denominations of a dollar
Find the relative rate of change of household income in 2015 : A model for the average income per household before taxes are paid is f(t)=1,700t + 20,500.- where t is years since 1980. Find the relative rate of change of household income in 2015.
How well did the manager describe current behavior : How successful was the manager at getting a commitment to the change? Do you think the employee would change?
Matlab program in a script file using a for-loop : Write a MATLAB program in a script file using a for-loop that determines and displays the first 20 Fibonacci numbers. Hint: Initialize the first and second elements to be 0 and 1, respectively, and calculate those elements from the third element on..
Improve efficiency in processing data in excel : Describe a situation in a work environment where the use of macros would improve efficiency in processing data in Excel. Identify the likely challenge(s) you would face in developing the macros, and suggest a plan for addressing the challenge.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Presentations at internal meeting of ciso staff members

You have been invited to participate in a "lightning round" of short presentations at an internal meeting of CISO staff members. For this activity you must prepare a 3 to 5 paragraph briefing statement which answers the following questions. Use in..

  Sydney logistics

Sydney's Logistics is a growing business that specializes in providing business services that many small firms do not have the expertise, the space or the resources to handle on their own. These services include warehouse receiving and storage, inter..

  Describe the use of the remote network monitoring

Describe the use of the Remote Network Monitoring (RMON) protocol and its relationship to SNMP.

  Functional programming languages

Discuss with critical comment, using appropriate illustrations from a range of programming languages, the extent to which the above statement can be considered true.

  Assignment on hd-dvd versus blu-ray

In recent times, HD-DVD and Blu-ray were competing technology formats for creating and watching movies on DVDs. Neither was compatible with the other. Eventually, Blu-ray won the competition. Use the Internet to research the competition between th..

  Describe constraints which encode that cell is observed

Describe constraints which encode that cell (1, 2) is observed and indicates mine is not present, that cell (2, 1) is observed and indicates a mine is present, and that remaining cells are unobserved.

  Specify internet connection via service provider

When you submit your plan, include a brief (1-2 paragraphs) description of your design in the assignment comments.

  Question regarding the checked on all phones

You have been given a suspect's phone and need to determine what was accessed and from where. What are some areas that should be checked on all phones?

  How would you price and hedge this option

You are an AU$ bank. An investor purchases a call option to buy a US$ share for 10 US$. How would you price and hedge this option?

  Computers and the future

What do you think the future of computer technology will be 5 to 10 years from now.  For example in the 1960's Star Trek have the flip communicator and then in the 1990's we have the motorola flip cell phone.

  What other justifications for this requirement can you think

What other justifications for this requirement can you think of?

  Explain object-oriented analysis and agile methodologies

Distinguish the object-oriented analysis and create models with structured analysis and design models. Write down Agile Methodologies?

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