Write a program that prints yourname

Assignment Help Computer Engineering
Reference no: EM132151545

Tasks

Write a program that prints

Lab 2 written by YOURNAME and calls two methods:

1. Input the number of quarters, dimes, nickels, and pennies from the user. Print out the number of coins and total value in dollars.

2. Input the number of cents from the user. Determine and print out the number of quarters, dimes, nickels, and pennies to add up to that number of cents. No, you can't use all pennies.

You should have local variables for each value that is entered and each value that you calculate. For example, for the first method there should be a local variable that stores the total dollar amount of the change, as well as a local variable for the total number of coins.

For the second method, we can use integer division and the mod operator to make change. Suppose the user enters 99 as the number of cents. The sequence of calculations should be as follows.

1) The integer division 99 / 25 can be used to determine the number of quarters (3).

2) Using the mod operator 99 % 25 determines the remaining number of cents to be converted into change (24).

3) Integer division 24 / 10 can be used again to determine the number of dimes (2).

4) The mod operator 24 % 10 can be used again to determine the remaining amount (4).

5) Next, for nickels, integer division 4 / 5 for the number of nickels (0) and a mod operation 4 % 5 for the remaining amount (4).

6) Whatever is left is the number of pennies (4).

 

Reference no: EM132151545

Questions Cloud

Review the ccpm approach and explanations : "Why, if there is a tendency to overestimate activity durations, and add safety to the end of a project, do so many projects come in behind schedule?"
How many bits are delivered to the network layer protocol : How many bits, including headers, are delivered to the network layer protocol at the destination?
Write a program that defines a class circle and implement : Write a program that defines a class Circle and implement it as required. The class Circle should consist of three private member variables.
Which technique is used in each of the following cases : Which technique (cryptography or steganography) is used in each of the following cases for confidentiality?
Write a program that prints yourname : Input the number of quarters, dimes, nickels, and pennies from the user. Print out the number of coins and total value in dollars.
What is the probability that in this group over : What is the probability that in this group over 15% of the children will be found nearsighted? Explain.
What is the sufficient capacity for the dlu to record 3 day : Each processor generates 16 KB of data per second. Sought: What is the sufficient capacity for the DLU to record 3 day s worth of data?
Finance class that uses? group-learning techniques : From a random sample of 6 students in an introductory finance class that uses? group-learning techniques
Compute the wacc based on the following scenario : Compute the WACC based on the following scenario if the company's effective income tax rate is 37.5%.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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