1 / 12

InputBox/OutputBox Example

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. InputBox/OutputBox Example. Problem: Write a program that will: 1. read in a file name and a double 2. write both to an OutputBox

dewey
Download Presentation

InputBox/OutputBox Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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”); } }

More Related