问题描述:
C语言作业,
Task:Program a quiz game with at least 4 questions.For each question,provide 4 alternative answers - 3 wrong answers and 1 correct answer.The computer has to check if the player has chosen a correct or a wrong answer.It should give direct feedback to the player and should count the number of correct answers.When the player has answered all questions the computer should show how many answers have been answered correctly and also the percentage of correctly answered questions.
Sample Output:
QUIZ
====
Q1:What is the heigth of the television tower in Berlin?
a:90 m b:368 m c:105m d:404m
Player enters "d".
Sorry,this is not correct!
Q2:How many bits have a byte?
a:8 bits b:1024 bits c:8192 bits d:8000 bits
Player enters "d".
Sorry,this is not correct!
Q3:How many states are in Austria?
a:9 b:45 c:12 d:14
Player enters "a".
Congratulation.This is correct.
Q4:What is the name of the US president.
a:Clinton b:Obama c:Wulff d:Merkel
Player enters "b".
Congratulation.This is correct.
You answered 2 of 4 questions (50%) correctly.
Task:Program a quiz game with at least 4 questions.For each question,provide 4 alternative answers - 3 wrong answers and 1 correct answer.The computer has to check if the player has chosen a correct or a wrong answer.It should give direct feedback to the player and should count the number of correct answers.When the player has answered all questions the computer should show how many answers have been answered correctly and also the percentage of correctly answered questions.
Sample Output:
QUIZ
====
Q1:What is the heigth of the television tower in Berlin?
a:90 m b:368 m c:105m d:404m
Player enters "d".
Sorry,this is not correct!
Q2:How many bits have a byte?
a:8 bits b:1024 bits c:8192 bits d:8000 bits
Player enters "d".
Sorry,this is not correct!
Q3:How many states are in Austria?
a:9 b:45 c:12 d:14
Player enters "a".
Congratulation.This is correct.
Q4:What is the name of the US president.
a:Clinton b:Obama c:Wulff d:Merkel
Player enters "b".
Congratulation.This is correct.
You answered 2 of 4 questions (50%) correctly.
问题解答:
我来补答展开全文阅读