Repetition and Files Lab: Language Quiz: Fall 2025
Learning Objective(s)
- Improve use of loops
- Learn to work with sequential files
- Introduction to exceptions
Overview of the Program
Write a program give a language vocabulary quiz
Specifics
- The program is to be called LangQuiz
- The program should prompt for the name of the file with vocabulary words in another language. You should generate your own file. The one provided is a sample. You may use an online tool to generate the list if you wish. Each word pair (first word is the English word, the second is the same word in a language of your choice) should be on a separate line. Some languages will be easier to use than others (because of the alphabet).
- Exceptions need not be caught
- The final results should include the score (as a percentage) and how many right out of the final total.
- You must use the file io processing covered in class (not another learned a different way).
Sample dialogue
Below is a sample dialogue. The prompts may vary but the input given by the user is to be the same format. Your output can vary somewhat as long as the required data is nicely displayed. Notes:
- You will notice the program is very case sensitive. That is fine.
- One word (Spanish for tree) may not be display right because of the special character. That is fine. The language you pick must display most foreign words correctly.
Filename? EnglSpanShort.txt
What is Manzana ? apple
Sorry, you are wrong.
The answer is Apple.
What is Casa ? House
Good job. You are right.
What is Agua ? Water
Good job. You are right.
What is Libro ? book
Sorry, you are wrong.
The answer is Book.
What is Perro ? Dog
Good job. You are right.
What is Gato ? Cat
Good job. You are right.
What is ┴rbol ? Tree
Good job. You are right.
What is Sol ? Sun
Good job. You are right.
You got a 0.75%.
6 out of 8.
You can also run a solution for this program if you want. See classroom instructions for more details.
Lab Hints
Submission
- Create a software development report
- For the system design, you need to make your own flowchart.
- For testing report,
- make sure your tests ensure that each statement is executed at least one.
- your expected output CANNOT be pasted from the dialogue of a running. Only the actual output may be pasted
- It should contain two different inputs that are "errors"
- For the improvement section, specify how many points were lost from the last lab that you should not lose points for on this lab because you corrected the problem
- create a pdf document from your software development report
- create an empty zip folder
- place only LangQuiz.java, your own testing files (not mine) and your pdf document into it
- submit the zip folder on canvas
Optional improvements
Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
- Allow the program to handle lowercase or uppercase as the same. If you do this, add a section to the SDR (Extra Credit) explaining how it works
- Allow for a more complex language (such as Korean, Japanese, Arabic, etc.) with a very different alphabet. If you do this, add a section to the SDR (Extra Credit) with instructions on how to make it work on a machine in the lab and how you figured this out.
- Submission instructions
- Call this program LangQuiz2 add it to the zip folder that contains the original solution.