Question: Creation in Java code: Description: a) Creation of a text file in the current working directory of your project having marks of unspecified
Creation in Java code:
Description:
a) Creation of a text file in the current working directory of your project having marks of unspecified courses (more than 5) separated by spaces. Give the name of the text file as firstname.txt. You can see my sample file for your reference:

b) Writing a program that prompts the user to enter the file name, read the marks from the file and displays their total and average up to two decimal places. Sample output

c)]Show the contents of the file temp.txt IN YOUR PROJECT after the following program is executed
public class Test
{ public static void main(String[] args) throws java.io.IOException {
java.io.PrintWriter output = new java.io.PrintWriter("temp.txt");
output.printf("amount is %f %e\r\n", 32.32, 32.32);
output.printf("amount is %5.4f %5.4e\r\n", 32.32, 32.32);
output.printf("%6b\r\n", (1 > 2));
output.printf("%6s\r\n", "Java");
output.close(); } }
Tooks VCS Window Help 23.45 34.56 78.34 67.34 68.21 16.89 89.23 56.43
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
