lundi 5 décembre 2016

Java - Small game development

I've tried the last 2 days to solve this problem and I couldn't do it. Its for a homework that we had in school. If you could help me solving it, it would be great thank you.

"Write a multiple-choice-question puzzle, selecting your own questions and answers. Your code needs to include 8 questions and answers (not necessarily computing-related) such as those listed below (in sample execution). • You can either hardcore your questions (and correct answer) in your code (and receive up to 80% mark). • Or you can make your code read the questions from a text file using a format that you define (and receive up to 100% mark). You should name your program McqGame and store it in a file named McqGame.java. Submit the code and, if appropriate, a text file with the questions. The following is a sample execution of the program:

java McqGame Question 1: What does CPU stand for? A. Central Power Unit B. Central Point of Use C. Central Processing Unit D. Centre of Poly-Unit Enter your answer: B Wrong, try again. Enter your answer: C Correct. Answer the next question. Question 2: Who was the inventor of Java? ... At the end you need to provide the overall results, e.g.: ... Question 1: 3 tries Question 2: 1 try ... Question 8: 2 tries Page 8 of 8"

Aucun commentaire:

Enregistrer un commentaire