subject

Create a class called Quiz. This class manages up to 25 Question objects (create at least 10). Attached below is the Question interface, which your questions must implement. Define two methods in Quiz: public void addQuestion(Question q) - This accepts a question object and adds it to it's list of questions public double giveQuiz() - This presents each question, one by one, to the user and asks for their answer. After each answer, it checks if the answer is correct and keeps track of the results. Finally, it returns the score the user got. Create at least 3 classes that implement Question. You have some freedom in choosing the exact types, but I suggest: MultipleChoiceQuestion TrueFalseQuestion ShortAnswerQuestion Again, each question class MUST implement the Question interface. Implement these methods appropriately for the question type. DO NOT MODIFY THE QUESTION INTERFACE IN ANY WAY. Create a new class called QuizTime, which only has a main() method. In this method, create all of your Question objects and a single Quiz object. Add all of your questions to the quiz, then call giveQuiz() and print out the results to the user. Follow ALL of our rules of encapsulation and proper project design For extra credit, after the quiz is over go through each of the wrongly answered questions and printout the question followed by the correct answer.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 10:00, austintules2005
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, sha273
Which option completes the explanation for conflict of interest in an organization
Answers: 1
image
Computers and Technology, 24.06.2019 10:10, nakeytrag
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
image
Computers and Technology, 24.06.2019 21:30, keelynnbarrier
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences. a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
You know the right answer?
Create a class called Quiz. This class manages up to 25 Question objects (create at least 10). Attac...

Questions in other subjects:

Konu
Mathematics, 27.08.2019 05:30