Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a flowchart in java for the following program: For each word in the file, output the original word and its encrypted equivalent in all

Design a flowchart in java for the following program:
For each word in the file, output the original word and its encrypted equivalent in all-caps. The output should be in a tabular format, as shown below. The output should be written to a file called results.out.
Here are the rules for our encryption algorithm:
- If a word has n letters, where n is an even number, move the first n/2 letters to the end of the word. For example, before becomes orebef
- If a word has n letters, where n is an odd number, move the first (n+1)/2 letters to the end of the word. For example: kitchen becomes henkitc
Here is a sample run of the program for the following input file. Your program should work with any file, not just the sample shown here.
Life is either a daring adventure or nothing at all
Program output
Life feLi
is si
either hereit
a a
daring ingdar
adventure tureadven
or ro
nothing ingnoth
at ta
all lal

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions