Pt2520 Unit 6 Assignment Guidelines

1676 Words4 Pages

Jibran Barakat

[Type the document subtitle]

[Pick the date]

Jbarakatcontrol



Contents
Initial investigation 2
Flowchart 2
Experimentation 5
Task a 9
Task B 14
Improving code 19
Task 3 21
Bibliography 22



Initial investigation
The task consists of generating a program which asks the user 10 mathematical questions. Using in each case any two numbers and addition, subtraction or multiplication. The finale score out of 10 should also be outputted at the end.
In addition to this I the program would need to ask the student for their class and then save their score data. Furthermore the results need to be organised by the last 3 results of the students, sorted in: alphabetical order with the users highest score, by the user’s highest scores highest – lowest and finally …show more content…

The tasks given would require trial and error as well as countless debugging – mainly due to the advanced functions needed such as file organisation.
One of the main functions I will be using is variables, and so I needed to test how they worked.
This would allow me to save the score of the user, question count, the correct answer and the users input.
Furthermore I paired the variables with a print function which would allow me to show the user questions and variables.


Next I would need to find a method of adding a random integer variable, as well as an operator.
As I had no prior knowledge to this, I completed a quick google search for my query.

After which I found a site called “stackoverflow”1 which a user wanted a method of generating a random integer between 0 – 9. A reply from another user led to the python documentation 2 which I decided to look for to gain more information.
It stated I needed to import the “random” class and use the random.randint method for to generate a random interger.
random.randint(a,

More about Pt2520 Unit 6 Assignment Guidelines

Open Document