ITP109_Lab3

ITP109_Lab3 - Use constants for 100 (DOLLAR), 25 (QUARTER),...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ITP 109 Lab 3 Goal In this lab, you will write a program - Vending Machine . You will practice using variables, constants, the Scanner class to get keyboard input, division and mod operators, and comments. Assignment Your program will determine the change to be dispensed from a vending machine . An item in the machine can cost between 25 cents and 1 dollar, and the machine accepts only a single dollar bill to pay for the item. You need to figure out the change that will be dispensed in quarters, dimes, nickels, and pennies. Use the division and mod operators to figure out the change.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Use constants for 100 (DOLLAR), 25 (QUARTER), 10 (DIME), and 5 (NICKEL). Create your program using Eclipse. Your project should be named Lab3 , and your Java class should be named VendingMachine . Use the Scanner class to get input from the user, and use System.out to print to the console window. Make sure to comment your code. Grading - 30 points total 10 points: User input and output 10 points: Calculating the change correctly 10 points: Comments, style, and proper submission...
View Full Document

This note was uploaded on 03/15/2010 for the course ITP 109x taught by Professor Trinagregory during the Spring '08 term at USC.

Ask a homework question - tutors are online