Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-07-2010, 05:01 PM   PM User | #1
connollyc4
New Coder

 
Join Date: Mar 2010
Location: New Jersey USA
Posts: 74
Thanks: 11
Thanked 4 Times in 4 Posts
connollyc4 is an unknown quantity at this point
Question Java Program which can compare results to a master list. Expert programmer!

Andrew: cherry
Andrew: orange
Andrew: apple

Bryan: apple
Bryan: orange
Bryan: cherry

Mike: orange
Mike: cherry
Mike: apple

Correct answer: apple
Correct answer: orange
Correct answer: cherry

How to develop a java program that can compare answers to the list of correct answers and output how many were correct

Example of output should be something like: Andrew 1 correct answer, Mike 0 correct answers, Bryan 3 correct answers.

Any help would be appreciated
connollyc4 is offline   Reply With Quote
Old 10-08-2010, 07:04 AM   PM User | #2
sujithpr
New Coder

 
Join Date: Aug 2009
Location: Cochin,India
Posts: 39
Thanks: 2
Thanked 1 Time in 1 Post
sujithpr is an unknown quantity at this point
You can store it in arrays.
String[] correctAnswers={"apple","orange","cherry"};

String[][] masterList={{"cherry","orange","apple"},{"apple","orange","cherry"},{"orange","cherry","apple"}};

masterList[0] contain Andrew's answers
masterList[1] contain Bryan's answers etc.

Now few comparison statements will do the job..

It seems like a home work ??
sujithpr is offline   Reply With Quote
Reply

Bookmarks

Tags
java

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:30 AM.


Advertisement
Log in to turn off these ads.