InputBox/OutputBox Example - PowerPoint PPT Presentation

About This Presentation
Title:

InputBox/OutputBox Example

Description:

OutputBox outBox = new OutputBox(display); InputBox/OutputBox Example. public class Example ... outBox.print(myInt); outBox.print(myDouble); outBox.saveToFile ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 13
Provided by: mccl8
Category:

less

Transcript and Presenter's Notes

Title: InputBox/OutputBox Example


1
InputBox/OutputBox Example
  • Problem
  • Write a program that will read in an int and a
    double, write both to an OutputBox and save it to
    a file.

2
InputBox/OutputBox Example
  • Problem
  • Write a program that will
  • 1. read in a file name and a double
  • 2. write both to an OutputBox
  • 3. save it to a file.

3
InputBox/OutputBox Example
  • public class Example

4
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)

5
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)

6
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)

7
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myNumber inBox.getInteger(Please Enter an
    Integer)

8
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myInt inBox.getInteger(Please Enter an
    Integer)
  • double myDouble inBox.getDouble(Please Enter
    a Double)

9
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myInt inBox.getInteger(Please Enter an
    Integer)
  • double myDouble inBox.getDouble(Please Enter
    a Double)
  • OutputBox outBox new OutputBox(display)

10
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myInt inBox.getInteger(Please Enter an
    Integer)
  • double myDouble inBox.getDouble(Please Enter
    a Double)
  • OutputBox outBox new OutputBox(display)
  • outBox.print(myInt)

11
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myInt inBox.getInteger(Please Enter an
    Integer)
  • double myDouble inBox.getDouble(Please Enter
    a Double)
  • OutputBox outBox new OutputBox(display)
  • outBox.print(myInt)
  • outBox.print(myDouble)

12
InputBox/OutputBox Example
  • public class Example
  • public static void main(String args)
  • MainWindow display new MainWindow(Example
    Program)
  • InputBox inBox new InputBox(display)
  • int myInt inBox.getInteger(Please Enter an
    Integer)
  • double myDouble inBox.getDouble(Please Enter
    a Double)
  • OutputBox outBox new OutputBox(display)
  • outBox.print(myInt)
  • outBox.print(myDouble)
  • outBox.saveToFile(SavedExample.txt)
Write a Comment
User Comments (0)
About PowerShow.com