CSI6208 Programming Principles Assignment 2
Individual programming project (Quiz Program)
Weight : 50%
Background Information
This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fundamentals covered in the first half of the unit.
CSI6208 Programming Principles Assignment
Academic Integrity and Misconduct
The entirety of your assignment must be your own work (unless otherwise referenced) and produced for the current instance of the unit. Any use of Generative AI e.g., ChatGPT and unreferenced content you did not create constitutes plagiarism, and is deemed an act of academic misconduct. All assignments will be submitted to plagiarism checking software which includes previous copies of the assignment, and the work submitted by all other students in the unit.
Remember that this is an individual assignment. Never give anyone any part of your assignment even after the due date or after results have been released. Do not work together with other students on individual assignments you can help someone by explaining a concept or directing them to the relevant resources, but doing any part of the assignment for them or alongside them, or showing them your work, is inappropriate. An unacceptable level of cooperation between students on an assignment is collusion, and is deemed an act of academic misconduct. If you are uncertain about plagiarism, collusion or referencing, simply contact your tutor, lecturer or unit coordinator.
You may be asked to explain and demonstrate your understanding of the work you have submitted. Your submission should accurately reflect your understanding and ability to apply the unit content.
CSI6208 Programming Principles Assignment
Assignment Overview
You are required to design and implement two related programs:
• “admin.py”, a CLI program that allows the user to manage a list of quiz questions which are stored in a text file. This program is referred to as the “Main Program” in the marking rubric. Develop this program before “quiz.py”.
• “quiz.py”, a GUI program that uses the data in the text file to implement a quiz game for the user to play. This program is referred to as the “GUI Program” in the marking rubric. Develop this program after “admin.py”.
The following pages describe the requirements of both programs in detail.
Starter files for both programs are provided along with this assignment brief to help you get started and to facilitate an appropriate program structure. Please use the starter files.
Please read the entire brief carefully, and refer back to it frequently as you work on the assignment. If you do not understand any part of the assignment requirements, contact your tutor. Be sure to visit the Canvas regularly for discussions and/or extra information.
The functions required in “admin.py” are detailed later in the assignment brief.
The following pages describe the requirements of both programs in detail.
Overview of “admin.py”
“admin.py” is a program with a Command-Line Interface (CLI) like that of the programs we have created throughout the majority of the unit. The program can be implemented in under 180 lines of code (although implementing optional additions may result in a longer program). This number is not a limit or a goal – it is simply provided to prompt you to ask your tutor for advice if your program significantly exceeds it. Everything you need to know in order to develop this program is covered in the first 7 modules of the unit. This program should be developed before “quiz.py”.
This program allows the user to manage a collection of quiz questions that are to be stored in a text file named “data.txt”. Use the “json” module to write data to the text file in JSON format and to read the JSON data from the file back into Python. See Reading 7.1 for details regarding this.
[
{
“question”: “In which year was Halley’s Comet last visible
from Earth?”,
“answers”: [“1986”],
“difficulty”: 3
},
{
“question”: “Where were the 2016 Summer Olympics held?”,
“answers”: [“rio de janeiro”, “rio”, “brazil”],
“difficulty”: 2
}
]
This example contains the details of two quiz questions, stored in a list. The details of each question are stored in a dictionary consisting of three items that have keys of:
• “question” (a string of the quiz question)
• “answers” (a list of strings representing all of the answers that are considered correct)
▪ Since the user will be typing their answer in the GUI program, a list of strings allows the program to
account for different variations of how a correct answer may be typed. It also allows for questions with multiple correct answers.
▪ They have been stored in lowercase to make it easier to match against the answer entered by the user.
• “difficulty” (an integer between 1 and 5 representing how difficult the question is)
If this file was to be read into a Python variable named data, then “data[0]” would refer to the entire dictionary containing the question about Halley’s Comet, and “data[0][‘difficulty’]” would refer to the integer of 3. “data[1][‘answers’]” would refer to the list of [“rio de janeiro”, “rio”, “brazil”].
Understanding the structure of this data and how you can use it is very important in many aspects of this assignment – in particular, you will need to understand how to loop through the items of a list and how to refer to items in a dictionary. Revise Module 3 and Module 7 if you are unsure about how to interact with lists and dictionaries.
CSI6208 Programming Principles Assignment
To Be Continuous…
Excellent Assignment Help
We Aim At:
- Lowest Price.
- 100% Uniqueness.
- Assignment Fastest Delivery.