Question
Write java code Text File Game Write a program that will ask the user for their name and then ask them to answer at least
Write java code
Text File Game Write a program that will ask the user for their name and then ask them to answer at least 5 multiple choice questions. The questions should all live in a file called questions.txt the file should look similar to the one below:
Q1) How tall is the CN Tower?
1)1000m 2)553m 3)1m 4)100m
Q2) What Is the Airspeed Velocity of an Unladen Swallow?
1) ...
Which will contain both the questions, the choices and the right answer. Your program will keep asking the user questions so long as there is more in the file and keep track of if the user got it right or wrong in a score variable. When the input file is out of questions and has gotten the last answer from the user it should tell the user their score and APPEND their score in a scores.txt file. The scores.txt file will record the users name and score. After the game is over it should show the users score along with other users who have played the game scores. You are expected to submit both your .java file and a file called questions.txt containing your questions (note: this is a good thing because it means you can structure them any way you want)
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