---
# System prepended metadata

title: Data of My Life Group 6

---


# Data of My Life Group 6

---

```:javascript=

// John's profile
const person = {
  firstName: "John",
  lastName: "Group Six",
  age: 21,
};
document.getElementById("Data_of_My_Life_Grp6").innerHTML =
person.firstName + " is " + person.age + " years old.";

//SETTING, GETTING, changing data states through a "program."
// How old will John next year?
let age=20;
if (age>=21) {
 age++;
} else {
  age = "John is 21. Use that number to know his age next year";
}
document.getElementById("Data_of_My_Life_Grp6").innerHTML = age;

 
// John goes to class every weekday.

const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];

const d = new Date();
let day = weekday[d.getDay()];// <<< The day of a week
 
// John has different schedule for each day. Mainly during weekdays, he is duties to attend classes and work on assignments.
 
if (Monday === true) {
  console.log("It's Monday, Math class at 8:00am and that's it for the day! ");
}
else if (Tuesday === true) {
  console.log("It's Tuesday, John has 3 classes: Drawing at 9:00 am, Art history at 1:00 pm, and Physics class at 5:00 pm ");
}
else if (Wednesday === true) {
  console.log("It's Wednesday, Physics lab project is due by 11:59pm every Wednesday, John will be working on it the entire day.");
}
else if (Thursday === true){
  console.log("It's Thursday, Math class at 10 am, and Literature review is due by 7:05 pm");
}
else if (Friday === true){
  console.log("It's Friday, no class, Art History report is due by 6:00 pm, movie date with Jane at 8:00 pm");
}
else {
  console.log("Nothing is planned, John can sleep in");
}


//Create FUNCTIONS that represent repeatable actions that 
// are part of the daily routine.
// John decides to write a program that monitors his schedule
// it will provide him information for classes for the day 
// or the week. He hopes that the program helps not miss
// his classes and also plan his week online from anywhere

function Class_Schedule (input_info){
// array of course name, day, and times
// ask for input (require text)
// if input is course, print day and times
// if input is day, print course and times
// else print error notification
}


// BONUS: Use functions INSIDE another function (composition.)
// John decides to share his schedule with his girlfriend
// He thinks it is a great idea so they can sync up their
// calendars for the term

function Calendar_Sync (email){
// input: type your email
// if email does not match girlfriend@gmail.com
// print error notification: "This content is no available"
// if email matches girlfriend@gmail.com
Class_Schedule(); // call the class schedule function
return results; // print output from Class_Schedule();
}
document.getElementById("Data_of_My_Life_Grp6").innerHTML = results;

 

//Using LOGIC:
// John is taking a progamming class that asks him to count how
// many classes he is taking in the current semester. He decides
// to write a program to count how many classes:

let total_classes = 6;
let how_many_classes = "";
let i = 1;
do {
  how_many_classes += i + "<br>";
  i++;
}
while (i < total_classes+1);
document.getElementById("Data_of_My_Life_Grp6").innerHTML = how_many_classes;


// John is ready to finish his term doing well and
// managing his time ....

Schedule_Close();

```