Question
I have asked this question 3 times already and to the person who kept giving diagrams for this question please stop. I need help with
I have asked this question 3 times already and to the person who kept giving diagrams for this question please stop. I need help with the code itself not diagrams. So please if someone can help me develop the code further it would be much appreciated.
This is the code I have so far. This code presents 10 random questions out of 20 and allows the user to input an answer. This code also generates a report at the end showing which questions the user got right and wrong and what score they got over 10.
What I need is the rest of the requirements outlined in the brief above such as the results being saved to the students profile, allowing the management of multiple student profiles and a generation of an overall class report, an admin access where an admin user can see all the students attempts but a user can only see their own attempts, a student login to their profile before the quiz starts, the allowance of multiple attempts which are saved against their individual profile and lastly all the questions and answers to be saved to a simple text file which is read by the quiz application.
Please help me with the code i do not need diagrams and i wasnt able to refund the question asked 3 times that got answered by the same person 3 times incorrectly.
This is the code pasted below that needs to be developed further. Please help me with the code as best as you can this assignment is very important to me, i hope you can understand. Also the comments are disabled for some reason, i was able to comment under posts but i no longer can, is there a solution to this?
class Question { String q; String []option; String answer; Question(String ques,String optionA,String optionB,String optionC,String answer) { this.q=ques; this.option=new String[3]; this.option[0]=optionA; this.option[1]=optionB; this.option[2]=optionC; this.answer=answer; } public String toString() { String s; s=this.q+" "; s+="(a) "+this.option[0]+" "; s+="(b) "+this.option[1]+" "; s+="(c) "+this.option[2]+" "; return s; } }
import java.util.Scanner;
public class Quiz { public static void main(String []args) { Scanner sc=new Scanner(System.in); Question ques[]=new Question[20]; ques[0]=new Question("What does P in OOP stand for?","Place","Phone","Programming","c"); ques[1]=new Question("What is Eclipse?","A lunar event","IDE","A skateboard","b"); ques[2]=new Question("What is The V-Model?","A cat","A building","A Software Life Cycle","c"); ques[3]=new Question("What type of language is used in OOP?","Java","French","German","a"); ques[4]=new Question("What is a feature of OOP?","Two arms","Inheritance","A beak","b"); ques[5]=new Question("What is used in OOP?","Objects","Cars","Chairs","a"); ques[6]=new Question("Choose a type of inheritance used in OOP.","Hybrid inheritance","No inheritance","Some inheritance","a"); ques[7]=new Question("Who used OOP first?","Nelson Mandela","Nikola Tesla","Alan Key","c"); ques[8]=new Question("What kind of diagrams are used in OOP?","Class Diagrams","Shape Diagrams","Entrance Diagram","a"); ques[9]=new Question("What is a key aspect in OOP?","The sky","Ethics","Animals","b"); ques[10]=new Question("What must be followed when doing OOP?","People","Trucks","ACM Code of Ethics","c"); ques[11]=new Question("What is a loop that never stops?","For Loop","Infinite Loop","Full Loop","b"); ques[12]=new Question("What special value is designated for controlling a loop?","Sentinel Value","Base Value","Control Value","a"); ques[13]=new Question("What is a method?","A philosophy","A collection of statements grouped together to perform an operation","A shark","b"); ques[14]=new Question("When an exception is generated, it is said to have been what?","Created","Called","Thrown","c"); ques[15]=new Question("What does counter++; do?","Adds 1 to counter","Adds 2 to counter","Adds 3 to counter","a"); ques[16]=new Question("What is an object?","A thing","Representation of an entity in the real world that can be distinctly identified","A name","b"); ques[17]=new Question("What is an array?","A train","A house","An object that can store a group of values, all of the same type","c"); ques[18]=new Question("You use this statement to throw an exception manually.","Throw","Call stack","Try block","a"); ques[19]=new Question("What can OOP be used for?","Making a rocket","Designing applications","Cooking food","b");
//Create a array to ask 10 q's out of the 20 int arr[]=new int[ques.length/2]; for(int i=0;i } System.out.println("Scroll up to see full report "); sc.close(); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started