Write an application that determines whether the first two files are located in the same folder as the third one. The program should prompt the user to provide 3 filepaths. If the files are in the same folder display All files are in the same folder, otherwise display Files are not in the same folder.
Write an application that determines whether the first two files are located in the same folder as the third one. The program should prompt the user to provide 3 filepaths. If the files are in the same folder display All files are in the same folder, otherwise display Files are not in the same folder.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
what is wrong with this code?
![Safari
File
Edit
View
History
Bookmarks
Window
Help
Wed Nov 17 3:02 PM
delmarlearning.com
Instructions
CompareFolders.java
TestData1.txt
TestData2.txt
TestData3.txt
rtleby
1 import java.nio.file.*;
2 import java.io.IOException;
3 import java.util.Scanner;
his course
Write an application that determines
whether the first two files are located in the
4
same folder as the third one. The program
5 public class CompareFolders{
</>
should prompt the user to provide 3
public static void main(String[] args) {
Scanner input
Path filel
Path file2 = Paths.get("/root/sandbox/TestData2.txt");
Path file3
if(pathl.equals(path2) && path2.equals(path3)){
System.out.println("Files are all in the same folder");
}
else{
System.out.println("Files are not all in the same folder");
}
7
filepaths. If the files are in the same folder
= new Scanner(System.in);
Paths.get ("/root/sandbox/TestDatal.txt");
8
display All files are in the same folder,
%D
A-Z
otherwise display Files are not in the
10
same folder.
11
Paths.get("/root/sandbox/TestData3.txt");
12
Test the program when the files are in the
13
14
oblem. If
same folder and when they are not. The
15
following filepaths can be used to test your
16
program:
17
}
19 }
18
1. /root/sandbox/TestDatal.txt
20
2. /root/sandbox/TestData2.txt
3. /root/sandbox/TestData3.txt
and
/root/sandbox/test/TestData3.t
xt
Grading
Write your Java code in the area on the
right. Use the Run button to compile and
run the code. Clicking the Run Checks
343
NOV
CC
17
ktv
280
go](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F708f045a-516f-43e3-baeb-dca79ee45915%2F90c12761-0392-406e-a5a6-3fbe72e324ea%2Fgcsn1cm_processed.png&w=3840&q=75)
Transcribed Image Text:Safari
File
Edit
View
History
Bookmarks
Window
Help
Wed Nov 17 3:02 PM
delmarlearning.com
Instructions
CompareFolders.java
TestData1.txt
TestData2.txt
TestData3.txt
rtleby
1 import java.nio.file.*;
2 import java.io.IOException;
3 import java.util.Scanner;
his course
Write an application that determines
whether the first two files are located in the
4
same folder as the third one. The program
5 public class CompareFolders{
</>
should prompt the user to provide 3
public static void main(String[] args) {
Scanner input
Path filel
Path file2 = Paths.get("/root/sandbox/TestData2.txt");
Path file3
if(pathl.equals(path2) && path2.equals(path3)){
System.out.println("Files are all in the same folder");
}
else{
System.out.println("Files are not all in the same folder");
}
7
filepaths. If the files are in the same folder
= new Scanner(System.in);
Paths.get ("/root/sandbox/TestDatal.txt");
8
display All files are in the same folder,
%D
A-Z
otherwise display Files are not in the
10
same folder.
11
Paths.get("/root/sandbox/TestData3.txt");
12
Test the program when the files are in the
13
14
oblem. If
same folder and when they are not. The
15
following filepaths can be used to test your
16
program:
17
}
19 }
18
1. /root/sandbox/TestDatal.txt
20
2. /root/sandbox/TestData2.txt
3. /root/sandbox/TestData3.txt
and
/root/sandbox/test/TestData3.t
xt
Grading
Write your Java code in the area on the
right. Use the Run button to compile and
run the code. Clicking the Run Checks
343
NOV
CC
17
ktv
280
go
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 4 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education