Skip to content
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
43 changes: 43 additions & 0 deletions homeWork.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
problem 1

var numChildren=4;
var partnerName="Fa";
var geographicLocation="france";
var jobTitle="System analyst";

var tellFortune = 'You will be a ' + jobTitle + ' in ' + geographicLocation + ' and married to ' +
partner + ' ' + ' with ' + numChildren + ' kids.';
console.log(tellFortune);

problem 2

var birthYear = 1995;
var currentYear = 2018;
var age = currentYear - birthYear;
console.log('They are either ' + age + ' or ' + (age - 1));

problem 3

var currentAge=23;
var maxAge=70;
var preDay=2;
var lifeYears= maxAge-currentAge;
var eatTotal =(preDay*360)*(lifeYears);
console.log("You will need "+eatTotal+" to last you until the ripe old age of " +maxAge);
var getCurrentYear=(new Date()).getFullYear();

problem 4

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

problem 5
var celsius = 40;
var celsiusConvert = (celsius*9)/5 + 32;
console.log(celsius + '°C is ' + celsiusConvert + '°F');
var fahrenheit = 30;
var fahrenheitConvert = ((fahrenheit - 32)*5)/9;
console.log(fahrenheit + '°F is ' + fahrenheitConvert + '°C');