NEAR EAST UNIVERSITY
FACULTY OF ENGINEERING
ECC102 ‒ PROGRAMMING AND PROBLEM-SOLVING
ASSIGNMENT 2
1. Write a simple calculator in Python.
The calculator should perform four basic calculations (addition, subtraction,
multiplication, and division) and should accept long calculations (up to 4
operations) with or without parenthesis. The user will enter the equation, and the
(correct) result will be displayed on the screen. Here are the examples for the
input of the calculator:
5+6
5+6*7
(5 + 6) * 7
5+9/3*7
(5 + 9) / (3 * 7)
5 + (9 / 3) * 7
2. Quiz Game
Description: In this assignment, you will create a simple quiz game where the user
will answer multiple-choice questions. The program will track the user's score, give
feedback on each answer, and finally display the total score at the end of the quiz.
Requirements:
1. Questions and Answers: Store the questions, choices, and their answers in
separate text files. [Link], [Link], and [Link] for the questions, choices, and answers.
2. Display Questions and Answers: Read Q and C text files to display the questions
randomly and A text file to check the answer.
3. Multiple Questions: The game will present multiple questions to the user, each
with four choices (A, B, C, D).
4. User Input: The player must select one of the options (A, B, C, or D) for each
question.
5. Score Calculation: After answering each question, the program will give feedback
(correct or incorrect) and update the score.
6. Final Score: After answering all questions, the program will print the user's final
score.
7. Game Replay Option: After finishing the quiz, the user should be asked if they
want to play again.
RULES
- LATE SUBMISSIONS WILL NOT BE ACCEPTED!
- CHEATING AND USING AI SUPPORT WILL CAUSE GETTING 0 (ZERO)
FROM THE ASSIGNMENT!
- SAVE AND SUBMIT YOUR PROGRAMS AS SHOWN BELOW VIA UZEM:
STUDENTNO_Ax_Qx.py
where STUDENTO is your Student Number. A and Q represent Assignment and
Question, and x is the number of Assignment and Question, respectively (i.e.,
20209999_A2_Q1 for Question 1, and 20209999_A2_Q2 for Question 2).
- MISTAKES IN THE SUBMISSION NAMES WILL CAUSE GETTING 0 (ZERO)
FROM THE ASSIGNMENT!