Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Jul 2017 |
Last Sign in: | 209 Weeks Ago, 4 Days Ago |
Questions Answered: | 15833 |
Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
The following code uses a Printwriter object to write data to a text file called "doggoneData.txt". The output must have the following format:
Â
Tippy 2
Rex 7
Desdemona 5
Â
Using Printwriter methods, enter code in the box below so that the data is written to the file as specified above.
Â
  String name1, name2, name3;
  int age1, age2, age3;
  name1 = "Tippy";
  name2 = "Rex";
  name3 = "Desdemona";
  age1 = 2;
  age2 = 7;
  age3 = 5;
  PrintWriter outputFile = new PrintWriter("doggoneData.txt");Â
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly