Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python language for solution SECTION A: Answer all questions. Part 1 Write a program using the python programming language to satisfy all the following requirements.

image text in transcribedimage text in transcribed

Python language for solution SECTION A: Answer all questions. Part 1 Write a program using the python programming language to satisfy all the following requirements. (Your answer MUST provide the code and it must reproduce the output on the next page. Please use an IDE like PyCharm. You may import 'math' and 'random' only if needed.) i) Make sure you #comment your code and that your code is clear and easy to read. Your code must run with no error messages, and it should be less than 100 lines. [20] ii) The program should generate a random simple mathematics problem, one of 4 types, either addition, subtraction, multiplication, or division. [25] iii) The program should ask the user 10 random questions, printing the question number each time. [5] iv) The player has 3 lives, and it is game over when they lose all 3 lives. [5] v) The program should give the user the score out of 10 at the end. [5] vi) The addition, subtraction and multiplication question should only use numbers from 1 to 12 BUT the division question can have numbers from 1 to 144. All answers must be integers! [5] INDICATIVE DEMOSTRATION OF RUNNING THE CODE Question 1 What is 6+7? 13 CORRECT! Question 2 What is 120 / 10? > 12 CORRECT! Question 3 What is 3+7? > 10 CORRECT! Question 4 What is 12-02 CORRECT! Question 5 What is 6.3? CORRECT! Question 6 What is 49 / 7? > 7 CORRECT! Question 7 What is 25/5? > 5 CORRECT! Question 8 What is 11 - 42 WRONG! Question What is 24 / 2? > 12 CORRECT! Question 10 What is 1 + 10? > 11 CORRECT! YOU WIN! Your score is e out of 10. This is the end of the exam

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago