Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dear student! Please follow the instructions to solve the problems: Write down an algorithm to solve this problem (b) Draw the flowchart of the proposed

image text in transcribed
image text in transcribed
Dear student! Please follow the instructions to solve the problems: Write down an algorithm to solve this problem (b) Draw the flowchart of the proposed algorithm (c) Write down the Java program for the solution Please solve Q4.2 (d) Run your Java program in IDE NetBeans NB! 1. The typical answer on the question expected to be graded with full mark can be found on the next page. Q4. It is convenient to quickly enacede the message you send through the internet to protect it. Leth.writs two programs that will encode and decode hidden messages 04.1. Program reads a file toEncode .txt which consists of 5 lines, cach line contains one characters only. After reading the input file program creates output file encoded Message.txt. Each line of this file correspond to the ASCII code of the character from input file toEncode.txt encoded Message H 101 72 1 108 108 111 Q4.2. Program reads a file encodedMessage.txt which consists of 5 lines and creates decodedMessage.txt file with decoded message encoded Message.txt decoded Messsage. Ext 72 H 101 108 108 111 Expected ptototype of the answer on typical question in the Assignment Q1. Write a Java program that creates an empty. Program print out a message "File created: filename" if file is created or "File already exists." il file already exists. The file name has to be entered by a use. 6 (*) Write down an algorithm to solve this problem 1 Start Print Input filename 3. Read a name of the file to create Create flie 5 i fle is crented print -File created: Plename" else print File already exists End (1) Draw the flowchart of the proposed algorithm (Figure 1) (c) Write down the Java program for the solution import exs.de. import IX.10.JRENCER import extilcone public class Scenteile! public static void durinistrin aces) tryt Scanner in = new Scannersystem.in); String filename = in.next(): File mxtile = new File(filename): if (tile.seateNewsle satem.out.printin/"File created+mte.setNome: else System est eritior"); } catch is e) { System.out.println("An error occurred"); BiStack tracell: 6-10.0-4-1 Do it like this example (6) Run your Juve program in IDE NetBeans please fications Output - Fles rund X File created input.txt BUILD SUCCESSFUL total tine seconds

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_2

Step: 3

blur-text-image_3

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

When is bad debts expense recorded when using the allowance method?

Answered: 1 week ago