DD1310/DD1314/DA3009 Programmeringsteknik 2013
Lab 3
Read chapters 4-5 and 7 of the textbook: Random numbers, for loop, strings, lists, tuples, dictionary, files.
Assignment: Write a program that organizes a VOCABULARY TEST.
The program should:
- Read the words from file.
- Print the list of words.
- Quiz the user on all the words, counting the number of correct answers.
- Print the number of correct answers after the quiz.
Extra work (not compulsory):
- Ensure that the program does not crash for faulty input.
- Calculate and print the precentage you got right.
- Give different comments depending on the proportion of correct answers.
Example:
Svenska Setswana
====================
pumpkin lerotse
porridge bogobe
meat nama
spinach morogo
buttermilk madila
chicken koko
maize mmidi
beans dinawa
Quiz
==================
What does lerotse mean?
1. porridge
2. spinach
3. pumpkin
Answer: 3
.
.
.