From f7d66e02134d3d5eb25a3704a4fbaf5581b06a82 Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Wed, 2 Oct 2024 20:28:59 +0000 Subject: [PATCH 1/7] Initial commit of program files. Created java scanner. WIP --- lesson_04/ljmcwilliams/findPrimeNum.java | 7 +++++++ lesson_04/ljmcwilliams/findPrimeNum.js | 0 2 files changed, 7 insertions(+) create mode 100644 lesson_04/ljmcwilliams/findPrimeNum.java create mode 100644 lesson_04/ljmcwilliams/findPrimeNum.js diff --git a/lesson_04/ljmcwilliams/findPrimeNum.java b/lesson_04/ljmcwilliams/findPrimeNum.java new file mode 100644 index 000000000..ed5f14b65 --- /dev/null +++ b/lesson_04/ljmcwilliams/findPrimeNum.java @@ -0,0 +1,7 @@ +import java.util.Scanner; //This allows us to use the scanner to take in user input +public class findPrimeNum { + public static void main(String[] args) { + Scanner input = new Scanner(System.in); + System.out.println("Please enter a whole number"); + } +} \ No newline at end of file diff --git a/lesson_04/ljmcwilliams/findPrimeNum.js b/lesson_04/ljmcwilliams/findPrimeNum.js new file mode 100644 index 000000000..e69de29bb From c9af03a6c0e7973b224f2805eef4ac581dddee2f Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Thu, 3 Oct 2024 14:29:34 +0000 Subject: [PATCH 2/7] finished java program. changed variable name for Scanner. added comments for clarity. --- lesson_04/ljmcwilliams/findPrimeNum.java | 29 ++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/lesson_04/ljmcwilliams/findPrimeNum.java b/lesson_04/ljmcwilliams/findPrimeNum.java index ed5f14b65..3b588aae5 100644 --- a/lesson_04/ljmcwilliams/findPrimeNum.java +++ b/lesson_04/ljmcwilliams/findPrimeNum.java @@ -1,7 +1,32 @@ import java.util.Scanner; //This allows us to use the scanner to take in user input public class findPrimeNum { public static void main(String[] args) { - Scanner input = new Scanner(System.in); - System.out.println("Please enter a whole number"); + Scanner objScanner = new Scanner(System.in); //A scanner named 'objScanner' + boolean isConditionMet = false; + + /*if the condition is met, the print statement within the loop will be printed. + If not, the print statement after the loop will be printed*/ + + System.out.print("Please enter a whole number: "); //User input prompt + double userInput = objScanner.nextDouble(); //This reads an integer value from the user + + /*to determine a number's primality, we can check to see if the division + of that number by 2 to (1 - that number) results in any whole number quotients. + Once we do the division we can compare that number to (int) number to see if the + values are equal.*/ + + /*the program should end if A: the first whole number quotient is found, indicating that + * indicating a number is not prime or if B: no whole number quotients are found within the + * range indicating the number IS prime.*/ + + for (int i = 2; i < userInput; i++) { + if ((userInput / i) == (int) (userInput / i)) { + System.out.println(userInput + " is not a prime number."); + isConditionMet = true; + break; //this helps jump out of the loop once this first whole number quotient instace is found + } + } if (!isConditionMet) { + System.out.println(userInput + " is a prime number."); + } } } \ No newline at end of file From 16719cf8dba5ca66624ea5c7995cb712fe36d9d7 Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Thu, 3 Oct 2024 17:38:35 +0000 Subject: [PATCH 3/7] populated the JS file. Implemented Node.js and added comments for clarity --- lesson_04/ljmcwilliams/findPrimeNum.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lesson_04/ljmcwilliams/findPrimeNum.js b/lesson_04/ljmcwilliams/findPrimeNum.js index e69de29bb..3b78c3b49 100644 --- a/lesson_04/ljmcwilliams/findPrimeNum.js +++ b/lesson_04/ljmcwilliams/findPrimeNum.js @@ -0,0 +1,21 @@ +const readline = require('readline'); //"require()" imports the readline module which will process the user input +const read = readline.createInterface({ + input: process.stdin, //this acts as an input scanner + output: process.stdout //this works like a normal console.log combined with a user's input +}); +let isConditionMet = false; + +/* When looking at the Node.js docs, it states '.question()' displays the query (in this case the user prompt). +It waits for an input and uses it as the first argument in a callback function (here I am using a arrow function). */ +read.question("Enter a number: ", (answer) => { + for (let i = 2; i < answer; i++) { + if ((answer / i) == parseInt(answer / i)) { //similar to the "(int)" statement in java, parseInt converts doubles to ints + console.log(answer + " is not a prime number."); + isConditionMet = true; + read.close(); //this works similar to a break statement in java and ends the program + } + } if (!isConditionMet) { + console.log(answer + " is a prime number."); + read.close(); + } +}) \ No newline at end of file From f1acbd4eec51920b3f3ce588200ec416b02dd154 Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Thu, 3 Oct 2024 20:05:37 +0000 Subject: [PATCH 4/7] added explanation readme file --- lesson_04/ljmcwilliams/README.md | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 lesson_04/ljmcwilliams/README.md diff --git a/lesson_04/ljmcwilliams/README.md b/lesson_04/ljmcwilliams/README.md new file mode 100644 index 000000000..5ca25dc29 --- /dev/null +++ b/lesson_04/ljmcwilliams/README.md @@ -0,0 +1,59 @@ +In this lesson, I explored the differences between Java and JavaScript. Despite their similar names, these languages have distinct features. + +- ## Key Differences +- ### Document Preparation: + + - Java requires preparation before defining variables and functions. +JavaScript has more flexibility with variable definitions. + +- ### User Input: + + - In Java, I used the Scanner class to prompt the user for number input. +This required importing Java's Scanner class. +In JavaScript, there is no built-in Scanner class, so I used Node.js as a workaround. +With Node.js, I utilized process.stdin for input and process.stdout for output (similar to console.log). + +- ### Loop Control: + + - Both languages allow for loops to be exited early, but the methods differ: +In Java, using a break statement within the loop will terminate it. +In JavaScript, I opted for read.close(), which achieves a similar effect. + +- ### Variable Declaration: + + - Java requires explicit declaration of variable types. +JavaScript automatically assigns variable types. +- ## Loop Behavior +Both languages share similarities in loop functionality: + +- **For Loops**: + - Take three expressions. + +- **If Statements**: + - Accept a condition and can be nested. + +- **Java Example** +```java +for (int i = 2; i < userInput; i++) { + if ((userInput / i) == (int) (userInput / i)) { + System.out.println(userInput + " is not a prime number."); + isConditionMet = true; + break; + } + } if (!isConditionMet) { + System.out.println(userInput + " is a prime number."); + } +``` +- **JavaScript Example** +```javascript +for (let i = 2; i < answer; i++) { + if ((answer / i) == parseInt(answer / i)) { + console.log(answer + " is not a prime number."); + isConditionMet = true; + read.close(); + } + } if (!isConditionMet) { + console.log(answer + " is a prime number."); + read.close(); + } +``` \ No newline at end of file From 5df0916cc7406eea65fa8512043f10b36860663b Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Mon, 7 Oct 2024 02:04:48 +0000 Subject: [PATCH 5/7] Initial commit, created and populated readme file --- lesson_05/ljmcwilliams/README.md | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 lesson_05/ljmcwilliams/README.md diff --git a/lesson_05/ljmcwilliams/README.md b/lesson_05/ljmcwilliams/README.md new file mode 100644 index 000000000..4c4821222 --- /dev/null +++ b/lesson_05/ljmcwilliams/README.md @@ -0,0 +1,84 @@ +## User Story 1: Offline Learning Mode for Language App +As a language learner,
I want an offline mode in the language learning app,
so I can continue learning without an internet connection. + +### Acceptance Criteria +
    +
  1. Access to Lessons: +
      +
    • Users can download specific lessons and exercises for offline access.
    • +
    • A clear indicator shows which lessons are available for offline use.
    • +
    +
  2. +
  3. Content Availability: +
      +
    • All downloaded lessons should be fully functional without an internet connection.
    • +
    • Any media (audio, video) within the lessons must be accessible offline.
    • +
    +
  4. +
  5. Sync Progress: +
      +
    • Users’ progress should sync automatically when the app reconnects to the internet.
    • +
    • Any completed lessons or exercises should be saved and updated in the user’s profile once online.
    • +
    +
  6. +
+ +## User Story 2: Receive E-Statements for Bank Account +As a customer,
I want to receive e-statements for my bank account,
so I can reduce paper waste. + +### Acceptance Criteria +
    +
  1. Customer Information Validation: +
      +
    • The system verifies that the customer has a valid and active email address before enabling e-statement delivery.
    • +
    • If the email address is invalid, the system prompts the user to update their information.
    • +
    +
  2. +
  3. E-statement Delivery +
      +
    • E-statements must be sent to the customer’s registered email address monthly (or according to the account’s statement cycle).
    • +
    • The email subject line should clearly indicate it is a bank statement (e.g., "[Bank Name] - Your Monthly Statement for [Month]").
    • +
    • The e-statement must be attached as a PDF file. +
    • +
    +
  4. +
  5. Notification Preferences Management: +
      +
    • The customer must be able to modify their email address or opt out of e-statements at any time through the bank's website or mobile app.
    • +
    • Upon opting out, the customer should receive a confirmation message, and the system should revert to sending paper statements.
    • +
    +
  6. +
+ +## User Story 3: Keyboard Navigation for Faster Programming +As a software engineer,
I want to be able to navigate the IDE using keyboard shortcuts,
so that I can perform actions more quickly. + +### Acceptance Criteria +
    +
  1. Shortcut configuration:
  2. +
      +
    • The IDE must provide a default set of keyboard shortcuts for common actions (e.g., opening files, saving files, navigating between files, searching, etc.).
    • +
    • The software engineer must be able to customize keyboard shortcuts through the IDE settings/preferences menu.
    • +
    • There must be an option to reset all keyboard shortcuts to their default settings.
    • +
    +
  3. Common actions support:
  4. +
      +
    • + The following common actions must be accessible via keyboard shortcuts: +
        +
      • Opening, closing, and saving files.
      • +
      • Navigating between open tabs or files.
      • +
      • Searching within the file and across the project.
      • +
      • Running and debugging the code.
      • +
      • Copying, pasting, and duplicating lines of code.
      • +
      • Formatting code and applying indentation.
      • +
      • Commenting and uncommenting lines or blocks of code.
      • +
      +
    • +
    +
  5. Shortcut discoverability:
  6. +
      +
    • The IDE must provide a way to view all available keyboard shortcuts (e.g., a "Keyboard Shortcuts" menu or help section).
    • +
    • When hovering over action buttons in the IDE interface, the corresponding keyboard shortcut must be displayed in the tooltip.
    • +
    +
\ No newline at end of file From bf53de1ee4bbaf5040ff876432d86bcf4fb9f5ef Mon Sep 17 00:00:00 2001 From: marleomac3 Date: Mon, 7 Oct 2024 14:05:43 +0000 Subject: [PATCH 6/7] modified lesson 5 quiz file. ran test to check for corrections --- lesson_05/quiz/src/lesson5.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index 9ad62bd67..74ec75628 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -38,7 +38,7 @@ export class Lesson5 { [AnswerChoice.C, "To insert an image"], [AnswerChoice.D, "To create a paragraph"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -52,7 +52,7 @@ export class Lesson5 { [AnswerChoice.C, "alt"], [AnswerChoice.D, "href"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.C, ); } @@ -66,7 +66,7 @@ export class Lesson5 { [AnswerChoice.C, "
"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -80,7 +80,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, "
"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -94,7 +94,7 @@ export class Lesson5 { [AnswerChoice.C, "Computer Style Sheets"], [AnswerChoice.D, "Cascading System Sheets"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -108,7 +108,7 @@ export class Lesson5 { [AnswerChoice.C, "text-color"], [AnswerChoice.D, "background-color"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -122,7 +122,7 @@ export class Lesson5 { [AnswerChoice.C, "/* this is a comment */"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.C, ); } @@ -136,7 +136,7 @@ export class Lesson5 { [AnswerChoice.C, "text-size"], [AnswerChoice.D, "text-style"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -150,7 +150,7 @@ export class Lesson5 { [AnswerChoice.C, "inline-block"], [AnswerChoice.D, "none"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -164,7 +164,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.A, ); } } From f7f089d3febb4bc570f5d953e9c51c7edf35619f Mon Sep 17 00:00:00 2001 From: "Anthony D. Mays" Date: Fri, 11 Oct 2024 04:46:40 +0000 Subject: [PATCH 7/7] chore: revert changes to quiz before submit --- lesson_05/quiz/src/lesson5.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lesson_05/quiz/src/lesson5.ts b/lesson_05/quiz/src/lesson5.ts index 74ec75628..9ad62bd67 100644 --- a/lesson_05/quiz/src/lesson5.ts +++ b/lesson_05/quiz/src/lesson5.ts @@ -38,7 +38,7 @@ export class Lesson5 { [AnswerChoice.C, "To insert an image"], [AnswerChoice.D, "To create a paragraph"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -52,7 +52,7 @@ export class Lesson5 { [AnswerChoice.C, "alt"], [AnswerChoice.D, "href"], ]), - AnswerChoice.C, + AnswerChoice.UNANSWERED, ); } @@ -66,7 +66,7 @@ export class Lesson5 { [AnswerChoice.C, "
"], [AnswerChoice.D, ""], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -80,7 +80,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, "
"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -94,7 +94,7 @@ export class Lesson5 { [AnswerChoice.C, "Computer Style Sheets"], [AnswerChoice.D, "Cascading System Sheets"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -108,7 +108,7 @@ export class Lesson5 { [AnswerChoice.C, "text-color"], [AnswerChoice.D, "background-color"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -122,7 +122,7 @@ export class Lesson5 { [AnswerChoice.C, "/* this is a comment */"], [AnswerChoice.D, ""], ]), - AnswerChoice.C, + AnswerChoice.UNANSWERED, ); } @@ -136,7 +136,7 @@ export class Lesson5 { [AnswerChoice.C, "text-size"], [AnswerChoice.D, "text-style"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -150,7 +150,7 @@ export class Lesson5 { [AnswerChoice.C, "inline-block"], [AnswerChoice.D, "none"], ]), - AnswerChoice.B, + AnswerChoice.UNANSWERED, ); } @@ -164,7 +164,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, ""], ]), - AnswerChoice.A, + AnswerChoice.UNANSWERED, ); } }