
Go backward to 6.2 Triangles
Go up to 6 Labs
Go forward to 6.4 BIG project
6.3 Change
This lab will get you to deal with
various conversions between real or floating point
numbers and integers. In Pascal, there are two standard functions,
round()
and trunc()
.
For this lab, please write a program that does the following:
- Prints out identification information:
- Your name
- TABER CSC130
- Lab 6.3: Change
- Request input, with a prompt, for a real number of dollars. This
needs to have the ability to input fractional parts of a penny.
- Print out the whole number of dollars.
- Print out the number of cents (rounded).
- Print out the fractional cents lost or gained.
- Convert the whole dollars to bills. Use only the denominations of
Hundreds, Fifties, Twenties, Tens, Fives, and Ones.
- Print out the total number of bills.
- Convert the cents to quarters, dimes, nickels, and pennies.
Print out theses values. Use the minimum number of coins.
(All pennies is NOT acceptable after 4 cents!)
- Print out the total number of coins.
Test your program with a number of values. Turn in a copy of
your program when run with the value $1,079.9945.
Mark your output with:
- Your name
- TABER CSC130
- Lab 6.3: Change
- The compiler and OS that you used.
- The size in bytes of the executable program
Place the lab in the instructor hand in box
in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site
