Skip to content
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

Yay!!! my first homework! #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
53 changes: 53 additions & 0 deletions HW.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//1-The Fortune Teller

var numberOfKids = 9;
var fatherName = "Abdulrahman";
var homeTown = "Alahsaa";
var jobTitle = "retired mother";
var motherName = "You will be a " + jobTitle + " in " + homeTown + ", and married to " + fatherName + " with " + numberOfKids + " kids.";
console.log(motherName);

//2-The Age Calculator

var currentYear = 2019;
var birthYear = 1995;

var possibleAge = currentYear - birthYear;
console.log("You are either " + possibleAge + " or " + possibleAge + ", substituting the values.")


//3-The Lifetime Supply Calculator

var currentAge = 24;
var maxAge = 85;
var estPerDay = 5;


var yearsToLive = maxAge - currentAge ;
console.log("Years that I will enjoy my favorite snack: " + yearsToLive )

var snackLover = yearsToLive * estPerDay;
console.log("I would eat a lot of snack for the rest of my life! the amount is: " + snackLover )

//Bonus
var currentYear = birthYear + currentAge;
console.log("This year is " + currentYear )


//4-The Geometrizer
var radius = 5;
var circumference = 2*radius;
console.log("The circumference is " + circumference);
var area = radius*radius;
console.log("The area is " + area);

//5-The Temperature Converter

var celsius = 14;
var cToF = (celsius*9)/5 + 32;
console.log(celsius + " Celsius is " + cToF + " fahrenheit");
var fahrenheit = 57;
var fToC = ((fahrenheit - 32)*5)/9;
console.log(fahrenheit + " Fahrenheit is " + fToC + " celsius");