Design and implement an english test

Assignment Help Python Programming
Reference no: EM131184439

Assignment Overview

You are required to design and implement an "English Test" program in which the user is presented with a word and then asked to answer a simple question about the word. After 5 words, the program shows the user's score and ends.

The 5 words are selected at random from the list of words in the starter file (english_test.py) provided to you with this assignment brief. Please use the starter file as the basis of your assignment code.

For each of the 5 words, the program randomly selects one of the following 4 questions to ask:

1) How many letters does the word contain?

2) How many vowels does the word contain?

3) How many consonants does the word contain?

4) What is letter # of the word? (# is a number, e.g. "What is letter 3 of the word?")

The entirety of this program can be implemented in under 125 lines of code (although implementing CSP5110 or optional additions may result in a program longer than this) - Ask your tutor for advice if you feel your program is unusually long or inefficient.

Program Requirements

The requirements begin where the starter file ends - after defining the "candidateWords" list. In the following information, numbered points describe a requirement of the program, and bullet points (in italics) are additional details, notes and hints regarding the requirement. Ask your tutor if you do not understand the requirements or would like further information.

1. Print a welcome message, and then set up the test by creating a list of 5 randomly selected words from candidateWords. Also create an integer variable for the user's score (set it to 0).
- This assignment brief will assume variable names of "wordList" and "score" for the variables mentioned above. Individual words in wordList will be referred to as "word".
- The wordList is created for you as part of the code provided in the english_test.py starter file.
- The "random.sample()" function can be used to randomly select a number of items from a list.

2. Enter a loop that repeats once for each word in wordList.
- Using a "for" loop and the "enumerate()" function is an effective way to loop through the words in wordList. See Lecture 3, Slide 38 for an example of this.
The body of this loop must...

Print the current word as well as the number of the word, e.g. "Word 1/5: HELLO".

Generate a random number between 1 and 4, and use it to choose which question is asked.

If the random number is 1, ask the user "How many letters does the word contain?" and prompt them for input. Assess their answer, and then print an appropriate message.
- Remember to convert the user's response to an integer so that you can assess it correctly.
- If the user answers correctly, remember to add 1 to the score variable. If they answer incorrectly, remember to show the correct answer as part of the "Incorrect!" message.

If the random number is 2, ask the user "How many vowels does the word contain?" and prompt them for input. Assess their answer, and then print an appropriate message.
- Remember to convert the user's response to an integer so that you can assess it correctly.
- Use the "countVowels" function (detailed below) to determine the correct answer.
- If the user answers correctly, remember to add 1 to the score variable. If they answer incorrectly, remember to show the correct answer as part of the "Incorrect!" message.

If the random number is 3, ask the user "How many consonants does the word contain?" and prompt them for input. Assess their answer, and then print an appropriate message.
- Remember to convert the user's response to an integer so that you can assess it correctly.
- Use the "countVowels" function here as well - all letters that are not vowels are consonants.
- If the user answers correctly, remember to add 1 to the score variable. If they answer incorrectly, remember to show the correct answer as part of the "Incorrect!" message.

If the random number is 4, randomly select a number within the length of the word, (e.g. if the word is HOUSE, a number between 1 and 5) and use it to ask the user "What is letter # of the word?", where "#" is the selected number. Prompt the user for input, assess their answer, and then print an appropriate message.
- Convert the user's response to uppercase so that you can assess it regardless of case.
- If the user answers correctly, remember to add 1 to the score variable. If they answer incorrectly, remember to show the correct answer as part of the "Incorrect!" message.

3. The last thing the program should do (after the body of the loop described in Requirement 2) is print a "Game Over" message that includes the user's score out of 5.


Attachment:- english-test.rar

Reference no: EM131184439

Questions Cloud

Which policing style utilizes the least amount of discretion : In the formal criminal justice process all defendants must go through which stage to ensure proper sentencing/punishment/dismissal/closure?
Calculate and plot the potential everywhere in space : Calculate the electric field intensity and potential between and outside the plates.
What does the graph show you about the relative importance : What does the graph show you about the relative importance of the software qualities? Are there any cycles in the graph? What does a cycle imply?
Evaluate the effectiveness of the process : Develop a 350-word evaluation of a recent business decision in your work or desired career.  Include the following: Evaluate the effectiveness of the process. What stages were most challenging and why
Design and implement an english test : CSP1150 - Programming Principles - You are required to design and implement an "English Test" program in which the user is presented with a word and then asked to answer a simple question about the word. After 5 words, the program shows the user's..
Provide explanation of your companys vision : With this project I am starting my own shoe company. I'm running this company with 2 other comanagers- provide explanation of your company's vision.
To what extent is louis ck right that our lives are evil : Comedian Louis C.K. is skillful in capturing the cognitive dissonance we experience between our moral beliefs and our actual moral behavior. To what extent is Louis C.K. right that our lives are evil
Create a decision tree with the software of your choice : Create a decision tree with the software of your choice to address risk number 6. Assume that when you check the schedule on day 60 of the project.
Plot the potential with respect to position : Potential due to point charge and spherical charge distribution. A point charge Q is surrounded by a uniform spherical charge distribution of radius a, having a uniform volume charge density pv.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd