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
/* | |
Training days is a service program that sends you a message for the event you signed up for and the days you have left to train. | |
In this project I made Training Days more maintainable and less error-prone by fixing variable scopes. | |
*/ | |
// The scope of `random` is too loose | |
//const random = Math.floor(Math.random() * 3);//defined with global scope |
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
/*Sleep Debt Calculator*/ | |
/*This project calculates if you’re getting enough sleep each week using a sleep debt calculator. | |
The program determines actual and ideal hours of sleep for each night of the last week. | |
It also calculates, in hours, how far you are from your weekly sleep goal.*/ | |
//Determins how many hours of sleep you got each night of the week. | |
const getSleepHours = day => { | |
if(day === 'monday'){ |
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
/* | |
Game code is broken down into four parts: | |
1. Get user’s choice. | |
2. Get computer’s choice. | |
3. Compare two choices and determine the winner. | |
4. Start the program and display the results | |
*/ | |
//Const arrow function | |
/*The user should be able to choose ‘rock’, ‘paper’, or ‘scissors’ when the game starts*/ | |
const getUserChoice = userInput => { |
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
/*A program that will register runners for a race and give them instructions on the race day. | |
A timeline of the registration: | |
How the registration works... | |
There are adult runners 18+ and youth runners -18 years of age. | |
They can register early or late. | |
Runners are assigned a race number and start time based on their age and registration. | |
Race number: | |
Early adults receive a race number at or above 1000. |
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
/*In this project I built a Magic Eight Ball using control flow in JavaScript. | |
A user's able to input a question, then the program will output a random fortune.*/ | |
var userName = 'Rayn'; | |
userName ? console.log(`Hello ${userName}!`):console.log('Hello!'); | |
let userQuestion = 'Am I beautiful'; | |
console.log(`${userName} asked... ${userQuestion} ?`); | |
let randomNumber = Math.floor(Math.random()*8); | |
let eightBall = ''; | |
switch(randomNumber){ |
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
/*Dogs mature at a faster rate than human beings. We often say a dog’s age can be calculated in “dog years” to account for their growth compared to a human of the same age. In some ways we could say, time moves quickly for dogs — 8 years in a human’s life equates to 45 years in a dog’s life. How old would you be if you were a dog? | |
Here’s how you convert your age from “human years” to “dog years”: | |
The first two years of a dog’s life count as 10.5 dog years each. | |
Each year following equates to 4 dog years. | |
With my knowledge of math operators and variables, I'll use JavaScript to convert my human age into dog years.*/ | |
//My age in human years |
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
/*JAVASCRIPT SYNTAX | |
Kelvin Weather Project | |
Deep in a mountain-side meteorology lab, a mad scientist Kelvin mastered weather prediction. | |
Recently, Kelvin began publishing his weather forecasts on his website. However there’s a problem: All of his forecasts describe the temperature in Kelvin. | |
With the knowledge of JavaScript, I'll convert Kelvin to Celsius, then to Fahrenheit. | |
Accomplishments: | |
1.Used console.log and string interpolation to log the temperature in fahrenheit to the console. |
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
SETDEV ENVIRONMENT | |
Daily Buzz | |
In this project, I used the commands I learned to navigate through files and directories of Daily Buzz, a national newspaper. | |
Tasks completed: | |
1.Printed the working directory. | |
2.Listed all files and directories in the current working directory | |
3.With one command, I changed directories to the national/politics/ directory. | |
4.Listed all files and directories in the working politics/ directory. |
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
Bicycle World | |
Welcome to Bicycle World, the premier text-based bicycle shop! This shop is only accessible to programmers like you, who are familiar with the command line. | |
In this project, I used the commands I learned to navigate and edit the filesystem. | |
The filesystem is shown below. Main directory is bicycle-world-ii. | |
bicycle-world-ii | |
|—— brands.txt | |
|—— freight/ |
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
/* | |
* The print Hello World app | |
*/ | |
/** | |
* | |
* @author raynz_000 | |
*/ | |
public class HelloWorld extends javax.swing.JFrame { |
NewerOlder