diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..b95853c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/README.md b/README.md index 4d9f4d9..ffb419f 100644 --- a/README.md +++ b/README.md @@ -51,18 +51,18 @@ Your assignment is to use Built-In java classes to: 1. Look up the latitude and longitude coordinates in any online map you can find via Google. 1. Screenshot the map and add it into the **images** folder of this project. 1. Last add image markdown below this line to load your map image (Hint: Example image Markdown is just a couple lines above this). - +![](images/Screenshot_53.png) ## PART 3 - Code Scanning and Interpretation * Look at the getHiddenSecrets method and identify the following parts by editing this README.md and providing your answers: - * What is the **access modifer** (e.g. public, private, protected)? - * Is it a **Class method** or an **object Instance method**, how do you know? - * What is its **return data-type**? - * Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**? + * What is the **access modifer** (e.g. public, private, protected)? Public + * Is it a **Class method** or an **object Instance method**, how do you know? Class method because its declared public static + * What is its **return data-type**? void + * Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**? 1 and the datatype is a file * Scan line by line through the code and try to determine how it works? - * What is familiar to you? - * What is not familiar to you? - * Do the **for** loops make sense, and if so, tell me what you think they do? + * What is familiar to you? the for loops are fimilar to me and the calling of methods + * What is not familiar to you? the catch is new to me and the format is weird to me and very clutterly because i dont know what the code is doing + * Do the **for** loops make sense, and if so, tell me what you think they do? they ruun the code as long as what you provided is still true ## PART 4 - Turn in diff --git a/images/Screenshot_53.png b/images/Screenshot_53.png new file mode 100644 index 0000000..7eb62b3 Binary files /dev/null and b/images/Screenshot_53.png differ diff --git a/src/HiddenSecrets.java b/src/HiddenSecrets.java index 71067b3..bf460a4 100644 --- a/src/HiddenSecrets.java +++ b/src/HiddenSecrets.java @@ -7,8 +7,10 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.file.Paths; +import java.util.Scanner; +import java.nio.file.Path; -// PUT YOUR IMPORTS HERE public class HiddenSecrets { public static void getHiddenSecrets(File file) { @@ -37,10 +39,16 @@ public static void getHiddenSecrets(File file) { } public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); // Put your code to request a file path, + System.out.println("Enter the file path:"); // read in a string from System.in, + String userInput = scanner.nextLine(); // convert that string into A Path type using Paths class, + Path filePath = Paths.get(userInput); + File fileObject = filePath.toFile(); // and call the getHiddenSecrets method to get the file's meta-data + getHiddenSecrets(fileObject); // HERE } }