1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
JulijaS [17]
4 years ago
5

Given a PrintWriter reference variable named output that references a PrintWriter object, write a statement that writes the stri

ng "Hello, World" to the file in to which output streams.
Computers and Technology
1 answer:
Nadya [2.5K]4 years ago
4 0

Answer:

A PrintWriter reference variable named output that references a PrintWriter object is as follows:

//PrintWriter output = new PrintWriter(outfile);

PrintWriter output = new PrintWriter("output.txt");

The statement that writes the string "Hello World" to the file output is as follows:

//output.print(message)

output.print("Hello World");

Explanation:

You might be interested in
The speed of sound depends on the material the sound is passing through. Below is the approximate speed of sound (in feet per se
german

Answer:

The Java Program for the given problem is as below. Directly copy the code and run it on your machine.

Explanation:

Refer the Screenshots attached for the output.

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class TheSpeedOfSound {

public static void main(String[] s)

{

String medium;

double distance;

double time;

try{

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

System.out.println("Enter one of the following: air, water, or steel: ");

medium = choice.readLine(); // reading input i.e. air, water or steel

//check for air water and steel

if (medium.equalsIgnoreCase("air") || medium.equalsIgnoreCase("water") || medium.equalsIgnoreCase("steel")){

System.out.println("Enter the distance the sound wave will travel: ");

distance = Double.parseDouble(choice.readLine()); // read distance value if it is air water or steel

switch (medium)

{

//if medium is air

case "air":

time = distance/1100;

System.out.print("It will take " + time + " seconds.");

break;

//if medium is water

case "water":

time = distance/4900;

System.out.print("It will take " + time + " seconds.");

break;

//if medium is steel

case "steel":

time = distance/16400;

System.out.print("It will take " + time + " seconds.");

break;

}

}

else{

System.out.print("Sorry, you must enter air, water, or steel.");  

}

}

catch(Exception e){

e.printStackTrace();

}

}

}

8 0
3 years ago
Which answer best describes an unsubsidized federal loan?
soldi70 [24.7K]

The answer is you are responsible for paying all the interest that accumulates on your loan. <span>For unsubsidized loans, the interest accumulates while you are in school, and 6 months after you graduate (or drop out) you will start paying on your loans. </span>

6 0
3 years ago
Which of these is NOT an example of a programming language?
777dan777 [17]
High level sorry if im wrong
7 0
3 years ago
Read 2 more answers
What is a video input device? .​
iren2701 [21]

Video input devices are used to scan images or videos from the outside world to the computer. The information can be stored in a multitude of formats depending on the user's requirements. Examples of types of video input devices include: digital camera. Digital camcorder.

7 0
3 years ago
Nonverbal communication includes _____.
aliya0001 [1]

Answer:

i think the answer is body language

Explanation:

body language is non-verbal

8 0
3 years ago
Read 2 more answers
Other questions:
  • Describe network in the terms of computer lab
    5·1 answer
  • propose,two new ,proudly South African ways,which you can visualize that the IoT,can be used at work to make life better.
    12·1 answer
  • When encountering another vessel in darkness or reduced visibility, what do visible red and green lights indicate
    9·1 answer
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • How many dog breed are there
    9·2 answers
  • And Python code for the following programming problem and the pseudo code below
    5·1 answer
  • Which is the most correct option regarding subnet masks?
    10·1 answer
  • Write features of Fifth Generation of computer?​
    12·2 answers
  • An e-commerce client is moving from on-premise, legacy systems to a cloud-based platform. During the transition, the client is a
    15·1 answer
  • What was your first pokemon game<br><br><br> if you have not played one just comment don't answer
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!