Explanation in english of algorithm

Assignment Help Basic Computer Science
Reference no: EM133234566

For this part of the assignment, take a look at the following pseudocode:

Get a value for change (in cents)

Set pennies to change

Set nickels, dimes, quarters to 0

While (pennies >= 5)

Set nickels to nickels + 1

Set pennies to pennies - 5

While (nickels >= 2)

Set dimes to dimes + 1

Set nickels to nickels - 2

While (dimes >= 5)

Set quarters to quarters + 2

Set dimes to dimes - 5

While (dimes >= 2 and nickels >= 1)

Set quarters to quarters + 1

Set dimes to dimes - 2

Set nickels to nickels -1

Print "Your change is"

Print the value of quarters and "quarters"

Print the value of dimes and "dimes"

Print the value of nickels and "nickels"

Print the value of pennies and "pennies"

1. What is output of this pseudocode for the following amounts? a. 14 b. 25 c. 99

2. What does this pseudocode do? brief explanation in English of the algorithm.

3. This algorithm uses many loops and steps. Is there a less complicated way to write this algorithm? different pseudocode for this algorithm that is shorter and more precise.

4. If you know how much change is in the cash register, how would you make sure that there are enough coins available to provide change for a given amount? short algorithm in pseudocode that asks the user for the number of quarters, dimes, and pennies in the register, as well as for the amount of change requested. If there is sufficient change in the machine, print out "There is enough money to make change." If there is not enough money, print out "There is not enough money to make change." For this problem any amount of change that adds up to the total is acceptable. For example if the register only has 100 pennies, you could make change for 97 cents by giving the customer 97 pennies. You do not have to output how to make the change, only if it is possible.

Reference no: EM133234566

Questions Cloud

Create html page-some text into webpage text widget : Create html page which supports the following. Allow a user to enter some text into a webpage text widget
Symbolic analysis of relay and switching circuits : In his MSc thesis, "A Symbolic Analysis of Relay and Switching Circuits", published in 1938, MIT computer science pioneer Claude E.
Represented in binary : Discuss how this format is represented in Binary.
Principles used on instagram application : Are any of these design principles used on Instagram application?
Explanation in english of algorithm : What does this pseudocode do? brief explanation in English of the algorithm. This algorithm uses many loops and steps.
Explain software vulnerabilities : Cybersecurity covers the fundamental concepts underlying the construction of secure systems from the hardware to the software to the human-computer interface,
Continuous quality improvement in health care : The Joint Commission (TJC), the Public health accreditation board (PHAB), and the Healthcare facilities accreditation program (HFAP).
What do you believe cort means talked about inspiration porn : 1- Do you agree with Cort's statement: "Ironic that one's family is a crucial part of someone's identity formation, yet we cannot choose our parents or siblings
Why is widal test commonly requested in patients : 1. Why is Widal Test commonly requested in patients suspected to have typhoid fever?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Research and report on at least five controls

You are an intern for a company that is acquiring an investment firm that must comply with the Gramm-Leach-Bliley Act (GLBA). Your supervisor wants you to research and report on at least five controls that the investment firm should have in place ..

  Relational database concepts

Describe how a third-generation language (3GL) programming language is used in conjunction with SQL to develop database applications.

  Network not have an ip address

Can devices on a network not have an IP address even if I'm using Netware, Appletalk, or NetBios?

  Significant differences in town village enterprises

What is the significant differences in Town Village Enterprises (TVE's) and State-Owned Enterprises (SOEs)? Did anything change during the years?

  Experience in msiss program of study

Briefly explain any steps you are taking, or plan to take, to gain hands-on experience in your MSISS program of study.

  Problem regarding the web development

Create a page with a 10 by 2 table that lists any twenty sports teams, pizza shops, or pet stores that you want to include. the table is to be on a separate pa

  Dollar price of a corolla

Assuming 75% pass-through, what will be the dollar price of a Corolla at the end of the year?

  Identify differences and similarities of the business models

What are they offering to their buyers or consumers via the Web (e.g., product, service, information, recreation)?

  What is Robot

University of the Cumberlands-What is a Robot and what are the common components of a Robot?

  Create a mailmerge

Create a Mailmerge-Your form letter must include an inserted picture or graphic and should give the address of a web site

  Good at solving social problems

Watch the video Michael Porter: Why business can be good at solving social problems. Post 1) what you garnered from the video 2) what social problem you feel business can solve at home or abroad and how this could be accomplished. 200 words minim..

  What represents the key success factors of ERM program

What represents the key success factors of the ERM program? The oral presentation should have highly developed and sustained viewpoint and purpose.

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