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

homework 2 - JS #9

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
36 changes: 36 additions & 0 deletions homework.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* The Fortune Teller */
var N = 10;
var Z = "Basem";
var X = "Story Teller";
var Y = "china";
console.log("You will be a " + X + "in" + Y + ", and married to " + Z + " with " + N + " kids.");
VM1190:5 You will be a Story Tellerinchina, and married to Basem with 10 kids.


/*The Age Calculator*/
var currentYear = 2019;
var birthYear = 1986;
var age = currentyear - birthyear;
console.log("They are either " + age + " or " + (age - 1));

/*The Lifetime Supply Calculator*/
var currentAge = 33;
var maxAge = 90;
var estimateAmount = 5;
var amount = (((maxAge - currentAge)* 365) * estimateAmount);
console.log("You will need " + amount + " to last you until the ripe old age of " + maxAge );

/* The Geometrizer */
var radius = 3;
var circumference = Math.PI * 2*radius;
console.log("The circumference is " + circumference);
var area = Math.PI * radius*radius;
console.log("The area is " + area);

/*The Temperature Converter*/
var c = 20;
var f = 34;
var cc = (f - 32)*9/5;
var ff = (c* (9/5)+32)
console.log(c + "°C" + "is" + ff + "°F");
console.log(f + "°F" + "is" + cc + "°C");