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

Info iconThis 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 hw2@engr3 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
Background image of page 1

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

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

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online