generated from jhans-404/fall22-mp2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ee59560
Showing
10 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# BOSS XTRAS | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Text Backup Files # | ||
*.s[a-w][a-z] | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# OS X Files # | ||
.DS_Store | ||
._* | ||
_* | ||
.Spotlight* | ||
.Trashes | ||
|
||
# Windows Files # | ||
Thumbs.db | ||
ehthumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Leap Year | ||
#### Respond to the following: | ||
|
||
1. Rewrite the following nested `if()` statements in a single line: | ||
``` | ||
if (year % 4 == 0) { | ||
if (year % 100 != 0) { | ||
// DO STUFF | ||
} // end inner if statement | ||
} // end outer if statement | ||
``` | ||
* **YOUR WRITING HERE** | ||
|
||
|
||
2. Label each as either correct or incorrect syntax. If incorrect, rewrite below: | ||
* if (x == y) { | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
* if [x == 10] { | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
* if x = 10 then { | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
* if (x equals 42) { | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
* if (x => y) { | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
|
||
3. Fix the error in the code below: | ||
|
||
``` | ||
Scanner console = new Scanner(System.in); | ||
System.out.print("What is your favorite color? "); | ||
String name = console.next(); | ||
if (name == "blue") { | ||
System.out.println("Mine, too!"); | ||
} | ||
``` | ||
|
||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# FizzBuzz | ||
#### Respond to the following: | ||
|
||
1. Fill out the following truth table: | ||
|
||
| P | Q | P && Q | P \|\| Q | | ||
|:--:|:--:|:------:|:--------:| | ||
| T | T | | | | ||
| T | F | | | | ||
| F | T | | | | ||
| F | F | | | | ||
|
||
|
||
2. Prove a version of DeMorgan's Law: | ||
|
||
| P | Q | P \|\| Q | ! (P \|\| Q) | !P | !Q | !P && !Q | | ||
|:--:|:--:|:--------:|:------------:|:--:|:--:|:--------:| | ||
| T | T | | | | | | | ||
| T | F | | | | | | | ||
| F | T | | | | | | | ||
| F | F | | | | | | | ||
|
||
3. What does DeMorgan's state and how did you prove it for the case above? | ||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Count Quarters | ||
#### Respond to the following: | ||
|
||
1. How do you isolate the ones digit of a number? | ||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Letter Grade | ||
#### Respond to the following: | ||
|
||
1. Write a plan for the following extension: | ||
* Attach a "+" on their grade if the grade ends in a 7, 8 or 9 (eg: 78 -> C+, 89 -> B+) | ||
* Attach a "-" on their grade if the grade ends in a 0, 1 or 2 (eg: 92 -> A-, 61 -> D-) | ||
|
||
* **YOUR WRITING HERE** | ||
|
||
|
||
2. Discuss how you would make sure 100 is not misrepresented as an A-. | ||
* **YOUR WRITING HERE** | ||
|
||
|
||
3. Discuss how you would make sure grades that are an F are not mislabeled as F- or F+ (eg: 49 -> F+ and 52 -> F-) | ||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Div By 3 | ||
#### Respond to the following: | ||
|
||
1. A number is considered *prime* if its only factors are 1 and itself. For example, 7 is prime (1 and 7 are the only factors) and 9 is not (1, 3 and 9 are factors). | ||
Outline an algorithm to determine whether or not a number is prime. | ||
Think of the following method header: | ||
`public static boolean isPrime(int num)` | ||
|
||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Shapes | ||
#### Respond to the following: | ||
|
||
1. Write a plan for the following output: | ||
``` | ||
000111222333444555666777888999 | ||
000111222333444555666777888999 | ||
000111222333444555666777888999 | ||
``` | ||
* **YOUR WRITING HERE** | ||
|
||
|
||
2. Write a plan for the following output: | ||
``` | ||
999998888877777666665555544444333332222211111 | ||
999998888877777666665555544444333332222211111 | ||
999998888877777666665555544444333332222211111 | ||
999998888877777666665555544444333332222211111 | ||
999998888877777666665555544444333332222211111 | ||
``` | ||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# String Puzzles | ||
#### Respond to the following: | ||
|
||
1. *In your own words*, discuss what each String method does: | ||
* `.substring(a)` | ||
* **YOUR WRITING HERE** | ||
|
||
* `.substring(a, b)` | ||
* **YOUR WRITING HERE** | ||
|
||
* `.indexOf(str)` | ||
* **YOUR WRITING HERE** | ||
|
||
* `.equals(str)` | ||
* **YOUR WRITING HERE** | ||
|
||
|
||
2. *In your own words*, discuss what the following `for` loop accomplishes for `String s`: | ||
``` | ||
for(int i = 0; i < s.length(); i++) { | ||
// DO STUFF | ||
} | ||
``` | ||
* **YOUR WRITING HERE** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# FDR High School - AP CS A | ||
## fall22-mp2-work | ||
|
||
|
||
### Last Name: | ||
### First Name: | ||
### GitHub Username: | ||
|
||
--- | ||
#### General Workflow: | ||
* Fill out the top of this form, commit and push it back to GitHub. | ||
* For each assignment, | ||
* `$ mkdir <assignment-number>-<topic>` (to be specified for each assignment) | ||
* Add files, commit and push them up to GitHub. | ||
* Commit frequently as you work. | ||
* Once finished with the assignment, edit the `README.md` to explain what you learned along the way. | ||
|
||
#### General Grading Rubric: | ||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.