Select Page

Houston Community College System Lottery Number Generator Program Exercises

Question Description

I’m working on a python exercise and need a sample draft to help me learn.

1. Number Analysis Program
Design a program that asks the user to enter a series of 20 numbers. The program should
store the numbers in a list and then display the following data:
• The lowest number in the list
• The highest number in the list
• The total of the numbers in the list
• The average of the numbers in the list

2. Driver’s License Exam
The local driver’s license office has asked you to create an application that grades the written
portion of the driver’s license exam. The exam has 20 multiple-choice questions. Here
are the correct answers:
1. A 2. C 3. A 4. A 5. D 6. B 7. C 8. A 9. C 10. B
11. A 12. D 13. C 14. A 15. D 16. C 17. B 18. B 19. D 20. A
Your program should store these correct answers in a list. The program should read the
student’s answers for each of the 20 questions from a text file and store the answers in
another list. (Create your own text file to test the application.) After the student’s answers
have been read from the file, the program should display a message indicating whether the
student passed or failed the exam. (A student must correctly answer 15 of the 20 questions
to pass the exam.) It should then display the total number of correctly answered questions,
the total number of incorrectly answered questions, and a list showing the question numbers
of the incorrectly answered questions.

3. Name Search
If you have downloaded the source code from this book’s companion Web site, you will find
the following files in the Chapter 07 folder:
• GirlNames.txt—This file contains a list of the 200 most popular names given to girls
born in the United States from the year 2000 through 2009.
• BoyNames.txt—This file contains a list of the 200 most popular names given to boys
born in the United States from the year 2000 through 2009.

Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application will display messages indicating whether the names were among the most popular.

4. Total sales
esign a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in a list. Use a loop to calculate the total sales for the week and display the result.

5. Lottery Number Generator
Design a program that generates a seven-digit lottery number. The program should generate seven random numbers, each in the range of 0 through 9, and assign each number to a list element. (Random numbers were discussed in Chapter 5.) Then write another loop that displays the contents of the list.

6. Larger Than n (Exercise 6)
In a program, write a function that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display all of the numbers in the list that are greater than the number n.

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now