-
Notifications
You must be signed in to change notification settings - Fork 166
JMC Lab #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcanizales23
wants to merge
1
commit into
joinpursuit:master
Choose a base branch
from
jcanizales23:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JMC Lab #156
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -6,6 +6,16 @@ | |
| // * Calculate your 2 possible ages for that year based on the stored values. | ||
| // * For example, if you were born in 1988, then in 2026 you'll be either 37 or 38, depending on what month it is in 2026. | ||
| // * Log them to the screen like so: "I will be either `ageMin` or `ageMax` in `futureYear`", substituting the values. | ||
| // const birthyear = 1988; | ||
| // const futureyear = 2020; | ||
|
|
||
|
|
||
| // let age = futureyear - birthyear; | ||
| // console.log('I will be either ' + age + ' or ' + (age - 1)) | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| // ## Problem Two | ||
|
|
||
|
|
@@ -15,6 +25,12 @@ | |
| // * Store an estimated snack amount per day (as a number). | ||
| // * Calculate how many snacks you would eat total, from your current age until the maximum age. | ||
| // * Log the result to the screen like this: "You will need `snackNumber` to last you until the age of `maxAge`". | ||
| //const currentage = 32; | ||
| //const maxage = 33; | ||
| //const snacknumber = 4; | ||
| //const totalneeded= 4; | ||
|
|
||
| //console.log("You will need '1,825' to last until the age of '33'") | ||
|
|
||
| // ## Problem Three | ||
|
|
||
|
|
@@ -24,6 +40,24 @@ | |
| // * Calculate the area based on the radius, and log "The area is `areaOfCircle`". | ||
| // * Hint: https://www.w3schools.com/jsref/jsref_pi.asp | ||
|
|
||
|
|
||
| //let raduis = 5; | ||
| //let circumference = 3.14 * 10; | ||
|
|
||
|
|
||
| //const circumferenceresult = 31.4; | ||
| //console.log("The circumference is " + circumferenceresult) | ||
| //const area = 3.14 * 25; | ||
|
|
||
| //const arearesult = 78.5 | ||
| //console.log("The area is " + arearesult) | ||
|
|
||
| //let name = "Corey" | ||
| //console.log('hellothere ${name or can be math}') | ||
|
|
||
|
|
||
|
|
||
|
|
||
| // ## Problem Four | ||
|
|
||
| // Temperature Converter: | ||
|
|
@@ -32,6 +66,16 @@ | |
| // * Now store a fahrenheit temperature into a variable. | ||
| // * Convert it to celsius and output "`tempInFahrenheit`°F is `tempInCelsius`°C." | ||
|
|
||
| //const celsius = 20; | ||
| //const celsiusInF = (celsius*9)/5 + 32; | ||
| //console.log(celsius + 'C is ' + celsiusInF + 'F'); | ||
| //const ft = 68; | ||
| //const fahrenheitInC = (ft - 32)*5/9; | ||
| //console.log(ft + 'F is ' + fahrenheitInC + 'F'); | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| // ## Problem Five | ||
|
|
||
|
|
@@ -44,6 +88,17 @@ | |
| // * Find the average grade of all students | ||
| // * Print out if Dee's grade is higher than the class average | ||
|
|
||
| //const AGrade = 98; | ||
| //const BGrade = 78; | ||
| //const CGrade = 100; | ||
| //const DtestG = 101 | ||
| //const FormulaforA= (AGrade + BGrade + CGrade + DtestG)/4; | ||
| //console.log(FormulaforA) | ||
| //console.log("Dee Grade is 100. Making it higher then the average") | ||
|
|
||
|
|
||
|
|
||
|
|
||
| // ## Problem Six | ||
|
|
||
| // Find the last number: | ||
|
|
@@ -54,6 +109,11 @@ | |
| // * Output: | ||
| // * 3 | ||
|
|
||
| //const A = 123 | ||
| //const B = 123%5 | ||
| //console.log(B) | ||
|
|
||
|
|
||
| // Hint: | ||
| // Use the remainder % operator. | ||
|
|
||
|
|
@@ -69,6 +129,14 @@ | |
| // * bob = 12 | ||
| // * Expected values: | ||
| // * alice = 27 | ||
| //const X = 3 | ||
| //const Y = 2 | ||
| //const Bob = 12 | ||
| //const Alice = Y * (Bob + X) | ||
|
|
||
| //console.log('Alice is older than Bob by ' + Alice + ' years') | ||
|
|
||
|
|
||
| // | ||
| // * Example 2 | ||
| // * Input: | ||
|
|
@@ -81,6 +149,12 @@ | |
| // * Hint: | ||
| // * alice + x = y * (bob + x) | ||
| // * Solve for alice | ||
| //const X = 1 | ||
| //const Y = 3 | ||
| //const Bob = 12 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. start variable names with lowercase. |
||
| //const Alice = Y * (Bob + X) | ||
|
|
||
| //console.log('Alice is older than Bob by ' + Alice + ' years') | ||
|
|
||
| // ## Problem Eight | ||
|
|
||
|
|
@@ -94,6 +168,13 @@ | |
| // * Output: | ||
| // * 25% of the daycare animals are cats | ||
| // * 75% of the daycare animals are dogs | ||
| //const numberOfCats = 20; | ||
| //const numberOfDogs = 60; | ||
| //const totalAnimals = 80; | ||
| //const percentageOfCats = ((20/(numberOfCats + numberOfDogs))*100); | ||
| //const percentageOfDogs = ((60/(numberOfDogs + numberOfCats))*100); | ||
| //console.log(percentageOfCats +`%` + ' are cats ' + percentageOfDogs + `%` + ' are dogs'); | ||
|
|
||
|
|
||
| // ## Problem Nine | ||
|
|
||
|
|
@@ -106,6 +187,19 @@ | |
| // * Years that are divisible by 100 are not leap years if they are not also divisible by 400. | ||
| // * For example 1900 was not a leap year, but 2000 was. Print "Leap year!" or "Not a leap year!" depending on the year you are provided. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow! Nice job! |
||
| //function leapYear(input) { | ||
| // let year = input; | ||
| // let answer; | ||
| // if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { | ||
| // answer = "Leap Year!"; | ||
| // } else { | ||
| // answer = "Not a leap year!"; | ||
| // } | ||
| // console.log(answer); | ||
| // } | ||
|
|
||
| // leapYear(2000); | ||
|
|
||
|
|
||
| // ## Problem Ten: Predict the output | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to use camelCase. birthYear