Building a Multiple Choice Quiz | Java | Tutorial 29

preview_player
Показать описание

Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation, and much more.
Рекомендации по теме
Комментарии
Автор

you are literally better at explaining code than my "professional" college prof. I feel like I should be paying you instead of him.

Eizuuu
Автор

alternate code:
public class mcq1 {
public static void main(String[] args) {
Scanner type = new Scanner(System.in);
int score=0;
String q1= "what color are apples?\n"
+"(a)red\n(b)blue\n";
System.out.println(q1);
String ans1=type.nextLine();
if(ans1.equals("a")){
score++;
}

String q2= "what color are bananas?\n"
+"(a)red\n(b)yellow\n";
System.out.println(q2);
String ans2=type.nextLine();
if(ans2.equals("b")){
score++;
}

System.out.println("you have scored:"+score+"/2");

}

}

SupreethM
Автор

Just found this gem of a tutorial, thank you it simple to understand! Im new to coding, this taught me a lot

AyshaFilms
Автор

Can you put a tutorial on this similar topic but using ArrayList

juniorr_gomez
Автор

Hi! I tried doing this, but i created an array for the questions and another one for the answers. At 12:13 I put it inside a for loop so i could do "new Questions(questionsarray[i], answersarray[i])" but then i can't do the "takeTest(questions)" part cause it doesn't recognize the questions variable. I tried inicializing it in other ways but there's always an error. How should i do it, any advice? Thanks

Sofiacchi
Автор

this is very creative. And extremely well explained. Thanks so much Mike.

ranjanadissanayaka
Автор

source code? your website does not display

alcotrades
Автор

On the off chance you see this because this comment is almost 4 years late, I would like to let you know your series of c++ and java are fantastic.

JudePhilips
Автор

Hi, I have some problem creating 20 questions quiz game.I can't define my variable.can you help me with that.thanks!

fengshili
Автор

Hi Mike! You are doing absolutely amazing. Please keep up. I am going through all your tutorials however for this one I have a question. Would this be an example of abstraction or encapsulation? Under which OOPs principle this falls under? And how?

falgunijaitly
Автор

Thanks for this video I managed to get most of my assignment done by following this :D

peacekeepermoe
Автор

Hi! Can you please put out a tutorial on the same topic but in JFrames with designing

alidabot
Автор

how to print the two strings (prompt and answer) together? System.out.print( questions[x].prompt, answer) did not work ?

ericgoovaerts
Автор

Thank you, no seriously thank you, I just finished my assignment because of this

AelroeZewdie
Автор

I like the way you teach Java thank you very much you came to rescue me

utjitaanitamunamava
Автор

Don't we need like setters and getters for these?

theencryptedpartition
Автор

this guy is awesome, he makes everything look so easy!
thank you man you saved my ass

bellalahyoussef
Автор

Thanks for this tutorial, it greatly helped my output test!

hadran
Автор

how to make this questions with scoring in try-catch exceptions?

johnvincentgenobaten
Автор

How to random the questions and answer?

markdalogdog