{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw2 - Programming Assignment 2 ENGR 3 Summer Session B 2006...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment 2 ENGR 3, Summer Session B 2006 Due: Thursday, August 17 @ 5 PM. Instructions: Complete the following parts. Turn these programs in using the command: “turnin [email protected] timestable.c change.c” Part A (10 points) In this assignment you will write a program that makes change for a purchase of candy. The price of the candy in cents is between 0 and 100 (inclusive), and the buyer pays with a $1 bill. The user should be prompted to enter a purchase price in cents. If the amount entered is not between 0 and 100, the program should ask for another input value until a correct value is put in. Your program should determine the amount of change the person receives from one dollar, and print out the number of quarters, dimes, nickels, and pennies that should be returned. Maximize the coins with the highest value. Follow the format of the examples below. The name of this program must be change.c Example 1. % a.out Enter the purchase price in cents [0-100]: 16 Your change of 84 cents is given as: 3 Quarters 0 Dimes
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern