Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Project Draw a class diagram for the below class (using UML notation) import java.io.BufferedReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; public class myData {

Java Project

Draw a class diagram for the below class (using UML notation)

image text in transcribed

import java.io.BufferedReader;

import java.io.FileWriter;

import java.io.IOException;

import java.io.InputStreamReader;

public class myData {

public static void main(String[] args) {

String str;

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter text (stop to quit).");

try (FileWriter fw = new FileWriter("test.txt")) {

do {

System.out.print(": ");

str = br.readLine();

if (str.compareTo("stop") == 0)

break;

str = str + " "; // add newline

fw.write(str);

} while (str.compareTo("stop") != 0);

} catch (IOException exc) {

System.out.println("I/O Error: " + exc);

}

}

}

1eimport java.io.BufferedReader; 2 import java.io.FileWriter; 3 import java.io.IOException; 4 import java.io.InputStreamReader; 6 public class myData [ 7 public static void main (String[] args) { String str; BufferedReader br new BufferedReader (new InputStreamReader (System.in)); System.out.println("Enter text ( stop' to quit)."); try (FileWriter fw= new FileWriter ("test.txt")| 10 do t System.out.print(": "); str br . readLine ( ) ; if (str.compareTo ("stop") 15 16 0) break str = str + " ". // add newline fw.write (str) 19 } while (str.compareTo ("stop") != 0); catch (IOException exc) 21 System. out.println("I/O Error:"exc)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions