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
4vir4ik [10]
3 years ago
9

Which method can be used to write data to a text file opened with the BufferedWriter object outfile?

Computers and Technology
1 answer:
maksim [4K]3 years ago
7 0

Answer:

Option (d) outfile.write();

Explanation:

As the object created for the class BufferedWriter is outfile, outfile.write is the correct syntax for writing in a text file. Here, write is the method used for writing into a text file. The data present is written in the textfile. Here, the text file is opened before writing the text into the file. Option (d) is correct.

Option (a) outfile.newLine(); is used to separate the lines. This is used to break the existing lines into smaller lines. This can also be used to start a new line. Here, newLine() is the method.So, option (a) is not suitable.

Option (b) outfile.existLine(); This is not a valid syntax as there is no method called existLine() in the class BufferedWriter. So, this is a wrong option.

Option (c) Write(outfile); This is not a valid syntax for writing in a text file. This is a wrong option.

You might be interested in
An employee wants to create a fake employee identification number as part of a fraud scheme. Which of the following controls wou
igor_vitrenko [27]

Answer:

The answer is "Self-Checking digits".

Explanation:

  • A self-check digit is a technique, that determines whether the identification number is valid or not. for example employee number, customer number, and invoice number.
  • It allocates by using the formula and the method, which will check that identified by a person that commits fraud by creating a false ID number.
4 0
3 years ago
In 2007, __________ Floridians were injured in alcohol-related collisions.
vovangra [49]

21

2121212121222 erhfjefbvervjgretg

7 0
3 years ago
Read 2 more answers
Write a program that contains three methods:
Reil [10]

Answer:

#include <stdio.h>//defining header file

int max (int x, int y, int z) //defining a method max that hold three parameters

{

   if(x>=y && x>=z)//defining if block that checks x is greater then y and x is greater then z

   {

       return x;//return the value x

   }

   else if(y>z)//defining else if block it check y is greater then z

   {

       return y;//return the value y

   }

   else//else block

   {

       return z;//return the value z

   }

}

int min (int x, int y, int z) //defining a method max that holds three parameters

{

if(x<=y && x<=z) //defining if block that check x value is less then equal to y and less then equal to z

{

return x;//return the value of x

}

if(y<=x && y<=z) //defining if block that check y value is less then equal to x and less then equal to z

{

return y;//return the value of y

}

if(z<=x && z<=x)//defining if block that check z value is less then equal to x  

{

return z;//return the value of z

}

return x;//return the value of z  

}

int average (int x, int y, int z) //defining average method that take three parameters

{

int avg= (x+y+z)/3;//defining integer variable avg that calculate the average

return avg;//return avg value

}

int main()//defining main method

{

   int x,y,z;//defining integer variable

   printf("Enter first value: ");//print message

   scanf("%d",&x);//input value from the user end

   printf("Enter Second value: ");//print message

   scanf("%d",&y);//input value from the user end

   printf("Enter third value: ");//print message

   scanf("%d",&z);//input value from the user end

   printf("The maximum value is: %d\n", max(x,y,z));//calling the method max

   printf("The minimum value is: %d\n", min(x,y,z));//calling the method min

   printf("The average value is: %d\n", average(x,y,z));//calling the method average

   return 0;

}

Output:

Enter first value: 45

Enter Second value: 35

Enter third value: 10

The maximum value is: 45

The minimum value is: 10

The average value is: 30

Explanation:

In the above-given code, three methods "max, min, and average" is declared that holds three integer variable "x,y, and z" as a parameter and all the method work as their respective name.

  • In the max method, it uses a conditional statement to find the highest number among them.
  • In the min method, it also uses the conditional statement to find the minimum value from them.
  • In the average method, it defined an integer variable "avg" that holds the average value of the given parameter variable.
  • In the main method, three variable is defined that inputs the value from the user end and passes to the method and print its value.      
7 0
3 years ago
Who knows a website to learn how to code in java?
Murrr4er [49]
Simple...

Although we are not allowed to link in websites..(against guidelines) you can search up codeacademy, this is a place to learn to code.

Thus, your answer.
6 0
3 years ago
Que es informatica????Ayudaaaaaa plis ​
chubhunter [2.5K]

Answer:

La informática, también llamada computación, es una rama de la ciencia encargada de estudiar la administración de métodos, técnicas y procesos con el fin de almacenar, procesar y transmitir información de forma digital

4 0
3 years ago
Other questions:
  • What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
    11·1 answer
  • What OS is most commonly used by businesses?
    11·1 answer
  • Select what's true about packet sniffers. Check All That Apply Legitimate sniffers are used for routine examination and problem
    15·1 answer
  • Use a physical stopwatch to record the length of time it takes to run the program. Calculate the difference obtained by calls to
    11·1 answer
  • NAT is able to stop ________. Group of answer choices a) scanning probes sniffers from learning anything about the internal IP a
    8·2 answers
  • You are tasked with designing an airplane that could carry a very large load of cargo. What type of airfoil would you use for th
    13·1 answer
  • What are real online jobs any one of any age can get pays weekly by Pay<br> Pal
    8·1 answer
  • Components of document merging?
    5·1 answer
  • 1. The opportunity to create several equations for launching program files is called
    5·1 answer
  • explain how principles of computational thinking skills are applied in finding solutions that can be interpreted into software a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!