5-4 - PrintWriter outputFile = new...

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

View Full Document Right Arrow Icon
import java.util.Scanner; import java.io.*; i public class 5-4 { public static void main(String[] args) throws IOException { int days; int total = 1; Scanner keyboard = new Scanner(System.in); System.out.print("How many days? "); days = keyboard.nextInt();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PrintWriter outputFile = new PrintWriter("Total.txt"); for (int i = 1; i <= days; i++) { total = total + (2^i); outputFile.println(2^i); } outputFile.println(total); outputFile.close(); } }...
View Full Document

This note was uploaded on 07/28/2009 for the course JAVA 1 taught by Professor M during the Spring '09 term at Anne Arundel CC.

Ask a homework question - tutors are online