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

  Implement key exchange using the diffie-hellman algorithm

Implement key exchange using the Diffie-Hellman algorithm, when peer-to-peer connections are made between bots. Achieve con dentiality through encryption of the client-server communications with an appropriate block or stream cipher

  Create a cheat commands in the game

ISCG5420 Programming Fundamentals - Create a cheat commands in the game so player can pick up any item he wants from any location in the map.

  Write a program that uses a bar

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  Design and implement mini-missions in the haunted house

Create a cheat commands in the game so player can pick up any item he wants from any location in the map. You have to name this cheat command 'giveme'

  You will define an operation on positive integers called

you will define an operation on positive integers called twiddle which consists of summing the squares of the digits of

  Displays the charges for a patients hospital stay

Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask patient name and if the patient was admitted as an in-patient or an out-patient.

  Display the percent-ages of the overall grade

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  Write a program that counts the frequencies of each word

Write a program that counts the frequencies of each word in a text, and output each word with its count and line numbers where it appears. We define a word as a contiguous sequence of non-white-space characters.

  Write a python program that reads a dumbbasic program

You should write a Python program that reads a DUMBBASIC program from standard input1, and prints the results of executing that program to standard output.

  Recursive sorts are easier to write in functional style

Recursive sorts are easier to write in functional style than others. Two recursive sorts are  Quicksort and Mergesort. Write functional versions of (a) Quicksort; (b) Mergesort in an  imperative language of your choice (e.g., C, Ada, C++, Python), us..

  Let ll be a list of integers

Let LL be a list of integers. Use list comprehension to produce teh following lists. Each one should just take onel line. Anser questions as two comments.

  Design an application in python

Design an application in Python- The application would generate a set of 100 integers in a random manner in the range of 50 to 150 including both the numbers in the range

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