Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,27 @@ 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).
![Screenshot](images/Screenshot 2023-09-10 193552.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)?
* -Public
* Is it a **Class method** or an **object Instance method**, how do you know?
* -A Class method, because it is static.
* What is its **return data-type**?
* -The return type is "void"
* Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**?
* -Yes, it requires 1 argument of type "File"
* Scan line by line through the code and try to determine how it works?
* What is familiar to you?
* -System.out.println , System.out.format()
* What is not familiar to you?
* -try,new,for,catch.
* Do the **for** loops make sense, and if so, tell me what you think they do?
* -I sort of understand it. Try = try to get thing, in this case the meta data.
* -For = use that data. If = if there is errors continue to catch. Catch = if specific error, respond with println.

## PART 4 - Turn in

Expand Down
Binary file added images/Screenshot 2023-09-10 193552.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/HiddenSecrets.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import java.io.IOException;

// PUT YOUR IMPORTS HERE

import java.nio.file.Paths;
import java.util.Scanner;
import java.nio.file.Path;
public class HiddenSecrets {
public static void getHiddenSecrets(File file) {
try {
Expand Down Expand Up @@ -38,9 +40,15 @@ public static void getHiddenSecrets(File file) {

public static void main(String[] args) {
// Put your code to request a file path,
Scanner filePath = new Scanner(System.in);
System.out.println("Input file path");
// read in a string from System.in,
String string = filePath.nextLine();
// convert that string into A Path type using Paths class,
Path path = Path.of(string);
// and call the getHiddenSecrets method to get the file's meta-data
getHiddenSecrets(path.toFile());
// HERE
System.out.println();
}
}