Question
this is for my Java class, so the answer needs to be written in Java. I have already created the input.txt file, so I just
this is for my Java class, so the answer needs to be written in Java.
I have already created the input.txt file, so I just need the java code.
Instructions:
Create text file (named input.txt) which has your full name on first line and your City of Birth in Second line. Write a program that reads the input.txt file and generates an output.txt file that has the following format:
- Your name should be written on second line, backwards
- Your City of Birth should be written on the first line
You will use something like this to take the input and produce the output:
File inputFile = new File(inputFileName); Scanner in = new Scanner(inputFile); PrintWriter out = new PrintWriter(outputFileName);
You will use a while loop to read the characters, so you will need to use charAt.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started