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

  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