Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions