All pastes #43307 Raw Edit

Updated Currency

public javascript v1 · immutable
#43307 ·published 2006-02-27 03:25 UTC
rendered paste body
import java.util.Scanner;public class Money {	private int dollars;	private int cents;	public Money() {		dollars = 0;		cents = 0;	}	public Money(int dollars) {		this.dollars = dollars;	}	public Money(int dollars, int cents)	{		this.dollars = dollars;		this.cents = cents;	}	public void readInput() {		Scanner keyboard = new Scanner(System.in);		System.out.println("Enter two amounts of money.  " +		"Put a space between the dollars and cents.  Do not use a decimal.");		int firstDollars = keyboard.nextInt();		int firstCents = keyboard.nextInt();		int secondDollars = keyboard.nextInt();		int secondCents = keyboard.nextInt();		Money firstAmount = new Money(firstDollars, firstCents);		Money secondAmount = new Money(secondDollars, secondCents);			}	}