![]() |
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 |
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.. :thumbsup: It seems like a home work ?? |
| All times are GMT +1. The time now is 11:28 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.