Instructions for JavaScript Code backbone: const input = require('readline-sync'); // TODO 2: modify your quiz app to as

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Instructions for JavaScript Code backbone: const input = require('readline-sync'); // TODO 2: modify your quiz app to as

Post by answerhappygod »

Instructions for JavaScript
Code backbone:
const input = require('readline-sync');
// TODO 2: modify your quiz app to ask 5 questions //
// TODO 1.1a: Define candidateName //
let candidateName;
// TODO 1.2a: Define question, correctAnswer, and candidateAnswer
//
let question;
let correctAnswer;
let candidateAnswer;
let questions;
let correctAnswers;
let candidateAnswers;
function askForName() {
// TODO 1.1b: Ask for candidate's name //
}
function askQuestion() {
// TODO 1.2b: Ask candidate the question and assign the
response as candidateAnswer //
}
function gradeQuiz(candidateAnswers) {
// TODO 1.2c: Let the candidate know if they have
answered the question correctly or incorrectly //
let grade;
return grade;
}
function runProgram() {
askForName();
// TODO 1.1c: Ask for candidate's name //

askQuestion();
gradeQuiz(this.candidateAnswers);
}
// Don't write any code below this line //
// And don't change these or your program will not run as expected
//
module.exports = {
candidateName: candidateName,
question: question,
correctAnswer: correctAnswer,
candidateAnswer: candidateAnswer,
questions: questions,
correctAnswers: correctAnswers,
candidateAnswers: candidateAnswers,
gradeQuiz: gradeQuiz,
runProgram: runProgram
};
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply