'F' → Fullscreen
Create a new JavaScript file named 1-7-console-input.js.
console.log("--- Demo 1 - Simple To-Do List ---");console.log("Let's add a few tasks to your list.");
let task1 = prompt("Task 1:");let task2 = prompt("Task 2:");let task3 = prompt("Task 3:");
console.log();console.log("Your To-Do List:");console.log(`1. ${task1}`);console.log(`2. ${task2}`);console.log(`3. ${task3}`);alert("Press enter to continue...");console.log("--- Demo 1 - Simple To-Do List ---");console.log("Let's add a few tasks to your list.");
let task1 = prompt("Task 1:");let task2 = prompt("Task 2:");let task3 = prompt("Task 3:");
console.log();console.log("Your To-Do List:");console.log(`1. ${task1}`);console.log(`2. ${task2}`);console.log(`3. ${task3}`);alert("Press enter to continue...");
console.log("--- Demo 2 - User Profile Setup ---");console.log("WELCOME! LET'S SET UP YOUR PROFILE...");
let username = prompt("Enter your username:");let subject = prompt("What's your favorite subject in school?");
console.log("Choose your preferred after-school activity:");console.log("- Sports");console.log("- Music");console.log("- Gaming");console.log("- Volunteering");let activity = prompt("->");
console.log();console.log("- Creating your profile -");console.log(`NAME: ${username}`);console.log(`FAVORITE SUBJECT: ${subject}`);console.log(`AFTER-SCHOOL ACTIVITY: ${activity}`);alert("Press enter to continue...");console.log("--- Demo 1 - Simple To-Do List ---");console.log("Let's add a few tasks to your list.");
let task1 = prompt("Task 1:");let task2 = prompt("Task 2:");let task3 = prompt("Task 3:");
console.log();console.log("Your To-Do List:");console.log(`1. ${task1}`);console.log(`2. ${task2}`);console.log(`3. ${task3}`);alert("Press enter to continue...");
console.log("--- Demo 2 - User Profile Setup ---");console.log("WELCOME! LET'S SET UP YOUR PROFILE...");
let username = prompt("Enter your username:");let subject = prompt("What's your favorite subject in school?");
console.log("Choose your preferred after-school activity:");console.log("- Sports");console.log("- Music");console.log("- Gaming");console.log("- Volunteering");let activity = prompt("->");
console.log();console.log("- Creating your profile -");console.log(`NAME: ${username}`);console.log(`FAVORITE SUBJECT: ${subject}`);console.log(`AFTER-SCHOOL ACTIVITY: ${activity}`);alert("Press enter to continue...");
console.log("--- Demo 3 - Simple Survey ---");console.log("We'd love to get your feedback!");
let favoriteColor = prompt("What is your favorite color?");let favoriteFood = prompt("What is your favorite food?");let travelDestination = prompt("Where is a place you would like to travel?");
console.log();console.log("- Survey Results -");console.log(`Favorite Color: ${favoriteColor}`);console.log(`Favorite Food: ${favoriteFood}`);console.log(`Travel Destination: ${travelDestination}`);alert("Press enter to continue...");console.log("--- Demo 1 - Simple To-Do List ---");console.log("Let's add a few tasks to your list.");
let task1 = prompt("Task 1:");let task2 = prompt("Task 2:");let task3 = prompt("Task 3:");
console.log();console.log("Your To-Do List:");console.log(`1. ${task1}`);console.log(`2. ${task2}`);console.log(`3. ${task3}`);alert("Press enter to continue...");
console.log("--- Demo 2 - User Profile Setup ---");console.log("WELCOME! LET'S SET UP YOUR PROFILE...");
let username = prompt("Enter your username:");let subject = prompt("What's your favorite subject in school?");
console.log("Choose your preferred after-school activity:");console.log("- Sports");console.log("- Music");console.log("- Gaming");console.log("- Volunteering");let activity = prompt("->");
console.log();console.log("- Creating your profile -");console.log(`NAME: ${username}`);console.log(`FAVORITE SUBJECT: ${subject}`);console.log(`AFTER-SCHOOL ACTIVITY: ${activity}`);alert("Press enter to continue...");
console.log("--- Demo 3 - Simple Survey ---");console.log("We'd love to get your feedback!");
let favoriteColor = prompt("What is your favorite color?");let favoriteFood = prompt("What is your favorite food?");let travelDestination = prompt("Where is a place you would like to travel?");
console.log();console.log("- Survey Results -");console.log(`Favorite Color: ${favoriteColor}`);console.log(`Favorite Food: ${favoriteFood}`);console.log(`Travel Destination: ${travelDestination}`);alert("Press enter to continue...");
console.log("--- Demo 4 - Fantasy Story Builder ---");console.log("Let's create a fantasy story!");
let mainCharacter = prompt("Name your main character:");let magicalCreature = prompt("Name a magical creature:");let aMagicalPlace = prompt("Name a magical place:");
console.log();console.log("- Your Story -");console.log(`Once upon a time, there was a hero named ${mainCharacter}.`);console.log(`${mainCharacter} traveled to the ${aMagicalPlace} to seek the legendary ${magicalCreature}.`);console.log("Their quest was just beginning...");Verify your program works correctly.
--- Demo 1 - Simple To-Do List ---Let's add a few tasks to your list.Task 1: Do HomeworkTask 2: Cook DinnerTask 3: Clean Bedroom
Your To-Do List:1. Do Homework2. Cook Dinner3. Clean BedroomPress enter to continue... [Enter]
--- Demo 2 - User Profile Setup ---WELCOME! LET'S SET UP YOUR PROFILE...Enter your username: amortimerWhat's your favorite subject in school? Computer ScienceChoose your preferred after-school activity:- Sports- Music- Gaming- Volunteering-> Gaming
- Creating your profile -NAME: amortimerFAVORITE SUBJECT: Computer ScienceAFTER-SCHOOL ACTIVITY: GamingPress enter to continue... [Enter]
--- Demo 3 - Simple Survey ---We'd love to get your feedback!What is your favorite color? purpleWhat is your favorite food? pizzaWhere is a place you would like to travel? Japan
- Survey Results -Favorite Color: purpleFavorite Food: pizzaTravel Destination: JapanPress enter to continue... [Enter]
--- Demo 4 - Fantasy Story Builder ---Let's create a fantasy story!Name your main character: AdaName a magical creature: GriffinName a magical place: Cleveland
- Your Story -Once upon a time, there was a hero named Ada.Ada traveled to the Cleveland to seek the legendary Griffin.Their quest was just beginning...Answer the following questions before submitting your work.
prompt() give back to your program — and what type of value is it, always?alert() between demos instead of just letting all four run back to back?Submit the required files to the appropriate dropbox.