Assignment 3 In this assignment you will practice file input and output. You are given two options: those who think up t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Assignment 3 In this assignment you will practice file input and output. You are given two options: those who think up t

Post by answerhappygod »

Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 1
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 1 (88.52 KiB) Viewed 21 times
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 2
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 2 (56.57 KiB) Viewed 21 times
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 3
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 3 (112.54 KiB) Viewed 21 times
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 4
Assignment 3 In This Assignment You Will Practice File Input And Output You Are Given Two Options Those Who Think Up T 4 (20.96 KiB) Viewed 21 times
Write code in JAVA Language. and do part 1 and 2. Send answer as
soon as possible. and also write comment for each part of the
code!
Assignment 3 In this assignment you will practice file input and output. You are given two options: those who think up to 60% is enough for them, solve the first part. Those who think they are to get full point, continue with the second part Part1 (basic: 60%) We have already seen how to copy a file using java. Utilizing that knowledge write a program that given a list of files (names) and the destination (all through command line input as executing the program), it will copy all those files into the destination folder. Note: if a specified path is a directory, mention that it is a directory, and skip copying it. Note: handle all the possible exceptional cases and user error. Note: every time a file is copied, print the number of bytes copied. Example: if file size is 36 bytes, print 36 B. if file size is 3635 bytes, print 4 KB. if file size is 3635124 bytes, print 4 MB. Part2 (medium: 40%) Given a list of directories and files followed by the destination copy all these directories(recursively) and files into the destination. Note: all the subdirectories and files inside the given directories must be kept in the same nested structure in destination folder.
Assume that the folder structure is as following: (use tree IF command to see the directory structure recursively, just tree on Mac or Linux) dest resources docs -books some citations.txt american London BEFORE ADAM.txt THE IRON HEEL.txt The People of the Abyss.txt -russian -Dostoevsky The Gambler.txt THE POSSESSED (The Devils).txt -Tolstoy MASTER AND M.Et -personal doc.txt doc2.txt Sened.docx adal.12 పదవ7.jpg download (1).jpg download.jpg Part1: Executing Java YourAppName "resources/img/ada 1.jpg" "resources/docs/books/some citations.txt" Output >Started: resourceslimglada1.jpg... >Finished FILE: resourceslimglada 1.jpg >Total 11KB were copied! >Started: resources docs\books some citations.txt... >Finished FILE: resources docs books some citations.txt >Total 435B were copied! -dest ada1.jpg some citations.txt Produces a dest) folder structure: Note: as you see, only the specified file(s) (not their paths) are created in the destination folder. a
Part2 Executing java YourAppName "resources/docs/books" "resources/docs/books/some citations.txt" dest Output: [Note that every nested folder and its contents are printed with one more indentation] >Started: resources docsbooks... >Started: resources docs books american... >Started: resources docs books american London... >Started: resources docs bookslamerican London BEFORE ADAM.txt... >Finished FILE: resources docs books american London BEFORE ADAM.txt >Total 229KB were copied! >Started: resources docs books american London THE IRON HEEL.txt... >Finished FILE: resources docs books american London THE IRON HEEL.txt >Total 528KB were copied! >Started: resources docs books american London The People of the Abyss.txt... >Finished FILE: resources docs books american London The People of the Abyss.txt >Total 370KB were copied! >Finished FOLDER: resources docs\books american London >Finished FOLDER: resources docs books american >Started: resources\docs\books russian... >Started: resources docs\booksvussian Dostoevsky... >Started: resources docs books russian Dostoevsky The Gambler.txt... >Finished FILE: resources docs\books russian Dostoevsky The Gambler.txt >Total 357KB were copied! >Started resources docs books russian Dostoevsky THE POSSESSED (The Devils). Ext... >Finished FILE: resources docs books russian Dostoevsky THE POSSESSED (The Devils).txt >Total 2MB were copied! >Finished FOLDER: resources docs\books russian Dostoevsky >Started: resources docs\books russian Tolstoy... >Started: resources docs books russian Tolstoy\MASTER AND MAN.txt... >Finished FILE: resources docs books russian Tolstoy\MASTER AND MAN.EXE >Total 127KB were copied! >Finished FOLDER: resources docs books russian Tolstoy >Finished FOLDER: resourcesdocs\books russian >Started: resources docs\books some citations.txt... >Finished FILE: resources docs books some citations.txt >Total 435B were copied! >Finished FOLDER: resources\docsbooks >Started: resources docs books some citations.txt... >Finished FILE: resources docs\books some citations.txt >Total 435B were copied!
-dest sone citations.txt -books some citations.txt -american London BEFORE ADAM.txt THE IRON HEEL.txt The People of the Abyss.txt russian Dostoevsky The Gambler.txt THE POSSESSED (The Devils).txt Tolstoy MASTER AND MAN.txt Produces a (dest) folder structure:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply