Question

see below:

You will be creating a personal quiz that will provide a grade depending on the responses given. The quiz should contain at l

Based upon the number of correct answers given, a grade should be computer through a user-defined function and provided to th

0 0
Add a comment Improve this question Transcribed image text
Answer #1

<html>


<head>


   <title>Online Quiz</title>


   <style type="text/css">

/*styles used */
       .dv-main{


           background-color: #1B4F72;


           opacity: 0.8;


           font-size: 40px;


           color: white;


           text-shadow:3px 3px 1px red ;/*shadow for text, shadow in color red*/


       }


       .dv-quiz{


           font-size: 20px;


           font-weight: bold;


       }


       .dv-result{


           background-color: #1B4F72;


           font-size: 30px;


           opacity: 0.8;


       }


   </style>


</head>


<body bgcolor="#1B4F72">


   <div class="dv-main">


       <center>


           Online Quiz


       </center>


   </div><br>


   <div class="dv-quiz">


<form target="_self">

<p>1. Decision-making structures cannot be nested.True or False ?</p>


<input type="radio" name="quiz1" value="true"> True<br>


<input id="q1o2" type="radio" name="quiz1" value="false"> False <br><br>

<p>2. Which of the following echo statement is invalid ? (Chapter 3,page 172-173)</p>


<input type="radio" name="quiz2" value="option1"> echo "&lt;p&gt;Welcome to the "combat zone"!&lt;/p&gt;";<br>


<input type="radio" name="quiz2" value="option2"> echo '&lt;p&gt;Welcome to the "combat zone"!&lt;/p&gt;';<br>


<input type="radio" name="quiz2" value="option3"> echo "&lt;p&gt;Welcome to the 'combat zone'!&lt;/p&gt;";<br>


<input id="q2o4" type="radio" name="quiz2" value="option4"> echo '&lt;p&gt;Welcome to the 'combat zone'!&lt;/p&gt;';<br><br>

<p>3. If you include an array within a text string , you need to use complex string syntax. True or False ?(Chapter 3,page 173</p>

<input id="q3o1" type="radio" name="quiz3" value="true"> True<br>


<input type="radio" name="quiz3" value="false"> False <br><br>


<input type="button" onclick="showResult()" value="Submit Quiz">

</form>


   </div>


   <br><br><br>


   <center>


       <div class="dv-result" id="dv-result">


       Your Score Will Be Here


   </div>


</center>


</body>


<script type="text/javascript">


   function showResult() {


       var grade=0;

//sets grade=99 if all three are true
   if(document.getElementById("q1o2").checked==true&&document.getElementById("q2o4").checked==true&&document.getElementById("q3o1").checked==true)


       {


           grade=99;


       }

//set grade=66 if any two is true

else if(document.getElementById("q1o2").checked==true&&document.getElementById("q2o4").checked==true||document.getElementById("q1o2").checked==true&&document.getElementById("q3o1").checked==true||document.getElementById("q2o4").checked==true&&document.getElementById("q3o1").checked==true)


       {


           grade=66;


       }

//set grade=56 if any one is true
       else if(document.getElementById("q1o2").checked==true||document.getElementById("q2o4").checked==true||document.getElementById("q3o1").checked==true)


       {


           grade=56;


       }

//set grade=0 if any one is not true
       else{


           grade=0;


       }
      

//sets colour according to grade
       if(grade>=80)


       {


           document.getElementById("dv-result").style.color="green";


       }


       else if(grade>=60)


       {


           document.getElementById("dv-result").style.color="yellow";


       }


       else if(grade>=50)


       {


           document.getElementById("dv-result").style.color="red";


       }


       else{


           document.getElementById("dv-result").style.color="black";


       }


       document.getElementById('dv-result').innerHTML="You Scored a " + grade + "% on this quiz";


   }


</script>


</html>

C Computer Science question ChOnline Quiz File | C/Users/svs97/Desktop/ceggQuizhtml С Online Quiz 1. Decision-making structur

Add a comment
Know the answer?
Add Answer to:
see below: You will be creating a personal quiz that will provide a grade depending on the responses given. The quiz should contain at least three questions of the true/false or multiple-choice natu...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a java application that is including a three-question multiple choice quiz about Java programming language....

    Write a java application that is including a three-question multiple choice quiz about Java programming language. Each question must have four possible answers (numbered 1 to 4). Also, ask user to type 0 to exit the test. [Assume that a user enters only integers 1,2,3,4, or 0]. Firstly, display a message that this quiz includes three questions about the Java programming language and display that each question has four possible answers. If the answer is correct for the given question,...

  • A short quiz has two true-false questions and one multiple-choice question with four possible answers. A...

    A short quiz has two true-false questions and one multiple-choice question with four possible answers. A student guesses at each question. Assuming the choices are all equally likely and the questions are independent of each other, the following is the probability distribution of the number of answers guessed correctly. What is the Probability of getting less than all three right? X            0            1            2            3 P(X)       .1875    .4375    .3125    .0625 Group of answer choices a) 1.0000 b) .9375 c) .6250 d) .3125

  • There are 18 questions, a combination of true/false, multiple choice, and fill in the blank. The...

    There are 18 questions, a combination of true/false, multiple choice, and fill in the blank. The fill in the that ask for text answers, those answers are not case sensitive. However, for those questions that req answer, please follow the instructions explicitly to get full credit for the answer You may use any of the materials from this course, the readings provided, or the HBS case materials. Y outside search engines or any websites derived therefrom. It is also expected...

  • 3. You are taking a multiple-choice quiz that consists of 6 questions. Each question has four...

    3. You are taking a multiple-choice quiz that consists of 6 questions. Each question has four possible answers, only one of which is correct. To complete the quiz, you randomly guess the answer to each question. a) Find the chance of guessing exactly three answers correctly b) Find the chance of guessing more than four answers correctly

  • A teacher gives an unannounced, three-question true false pop quiz, with two possible answers to each...

    A teacher gives an unannounced, three-question true false pop quiz, with two possible answers to each question. Complete parts (a)-(C) below. 2. Use a tree diagram to show the possible response patterns, in terms of whether any given response is correct or wrong. Choose the correct answer below. ОА OB OC OD C w w How many outcomes are in the sample space? There are outcomes in the sample space. b. An unprepared student guesses all the answers randomly. Find...

  • Write a C++ program that will deliver a multiple choice quiz. The program should Read questions...

    Write a C++ program that will deliver a multiple choice quiz. The program should Read questions from the file questions.txt Read the answer key for each test question from the file answers.txt When the program runs it will present each question and obtain a response After all questions have been answered, the program should output a report with the question number, the response given and either “correct” or “incorrect”. Show the output on the console and store the report in...

  • So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I...

    So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I need help editing my code. I want my quiz to clear the screen after each question. It should do one question at a time and then give a retry of each question that was wrong. The right answer should appear if the retry is wrong. After the 1 retry of each question, a grade should appear. Please note and explain the changes you make...

  • Covers Chapters 6-8 This exam includes 25 multiple-choice and true/false questions You have four hours to...

    Covers Chapters 6-8 This exam includes 25 multiple-choice and true/false questions You have four hours to complete this exam Due Sunday at 11:59 p.m. ET Question 8 3 pts A budget can help implement Strategic planning Short-run planning Long-run planning All of these answers are correct - Previous Next →

  • Multiple choice questions Need true or false answers Based on the information provided true or false...

    Multiple choice questions Need true or false answers Based on the information provided true or false questions needed Choose from the options the correct answer Sorry for typing wrong the answers must be selected from the 4 given and one must be selected Question 8 to 9 is answered but this one is not answered... 1O Marks Question 1 tach of these inuite chelce s a fu ested areers, AL BL nd UPAT ould read ach ques and then deside...

  • *Java* Given the attached Question class and quiz text, write a driver program to input the...

    *Java* Given the attached Question class and quiz text, write a driver program to input the questions from the text file, print each quiz question, input the character for the answer, and, after all questions, report the results. Write a Quiz class for the driver, with a main method. There should be a Scanner field for the input file, a field for the array of Questions (initialized to 100 possible questions), and an int field for the actual number of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT