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

The process is done #21

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
33 changes: 33 additions & 0 deletions homework.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
The Age Calculator :

first store declear var currentYear and birthYear in variable
calculate 2 possible ages based the stored values .
Output them to the screen

My code solution :
var currentYear = 2019;
var birthYear = 1988;
console.log(currentYear - birthYear);
the output:31
console.log(currentYear - birthYear || currentYear - (birthYear-1));
the output: 31
console.log(" They are " + currentYear - birthYear || currentYear - (birthYear-1));
the output: 32


The Geometrizer:
Store a radius into a variable.
store circumference into a variable , and then calculate the area based on area .

My code solution:
var radius = 2;
var pi = 3.14;
area = pi*radius*radius;
12.56
console.log("The area is " + area );
VM2591:1 The area is 12.56
var circumference = 2 * pi *radius;
console.log("The circumference is " + circumference);
The output: The circumference is 12.56
var circumference = 2*pi*radius;
var circumference = (2*pi*radius);