Fine2 - if (BookCost < 0) { IO.reportBadInput(); return;...

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

View Full Document Right Arrow Icon
public class Fine2 { public static void main(String[] args) { System.out.println("How many days is your book late?"); int numDays = IO.readInt(); if (numDays < 0) { IO.reportBadInput(); return; } System.out.println("How much does your book cost?"); int BookCost = IO.readInt();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if (BookCost < 0) { IO.reportBadInput(); return; } if (numDays <= 7) { IO.outputIntAnswer(numDays * 10); } else if (numDays <= 90) { IO.outputIntAnswer((numDays - 7) * 20 + 70); } else { IO.outputIntAnswer((numDays - 7) * 20 + 1070 + BookCost); } } }...
View Full Document

This note was uploaded on 07/12/2009 for the course CS 111 taught by Professor Hari during the Fall '08 term at Rutgers.

Ask a homework question - tutors are online