Please write the whole question, is it asking for the function that requests user input?
ANSWER: Here 3 print line statements are needed. So, the best code would be
import java.util.Scanner;
public class business {
public static void main(String args[]){
Scanner stdin = new Scanner(System.in);
String Larry = stdin.nextLine();
String Curly = stdin.nextLine();
String Moe = stdin.nextLine();
System.out.println(Larry +"\t" + Curly + "\t" + Moe);
System.out.println(Larry + "\t" + Moe + "\t" + Curly);
System.out.println(Curly + "\t" + Larry + "\t" + Moe);
System.out.println(Curly + "\t" + Moe + "\t" + Larry);
System.out.println(Moe + "\t" + Larry + "\t" + Curly);
System.out.println(Moe + "\t" + Curly + "\t" + Larry);
}
}
Answer:
Option b outFile.open("outputData.out");
Explanation:
In C++, there are several classes given to handle output and input of characters to or from files. They are:
- ofstream that write on files
- ifstream that read from files
We can use an object of ofstream to hold the contents that we wish to output to an external file. The general syntax is as follows:
ofstream_obj.open(file_name)
This will create a file with a specific file name and it possesses all the contents from the obstream_obj.