Sunteți pe pagina 1din 46

A453 Programming task

Name: Liam Jones

A453 Programming task


Name: Liam
Jones
Centre Number: 58313
Candidate Number: 1103

1 | Page

A453 Programming task

Name: Liam Jones

Contents
1. Introduction
2. Task 1
a) Analysis
b) Success criteria
c) Programming techniques
d) Variables and validation
e) Test plan
f) Algorithms
g) Development evidence
h) Testing
i) Contents

2 | Page

A453 Programming task

Name: Liam Jones

Introduction
Task 1
For this task, I have been asked to create a program that will test primary school
children on their basic arithmetic skills.
The program should generate a quiz consisting of randomised questions using any
two numbers and addition, subtraction and multiplication. It will have to be able to
record the students name and ask 10 questions and mark the questions out of 10
I will also be using an array of variables that will allow for more than one change at a
time. Task 1 heavily relies on the Arithmetic and logic unit (ALU) of the CPU (Central
processing unit) because task 1 mostly consists of calculations and logic in the
sense of adding, subtracting, dividing and multiplication. In addition, the program
works off the ram meaning no information is stored on the hard drive/solid state drive
and when the program ends or the computer is turned off the programs information
is lost and no longer exists.
For task 1, task 2 and task 3 I will be using a High level programming language. A
high-level language is usually stated high level because of it similarity to human
language. languages like FORTRAN, C, C++ and python are all very similar to
human languages, but languages like Befunge, chef and FALSE are all high-level
languages that are not similar to human languages because of the complexity these
types of languages are called esoteric programming languages.

Success criteria

The program must be able to generate 10 maths questions


Must be able to ask and remember students name
Must have a range of random integer
Must not have repetitive questions
The programs able to mark questions and put right answers
Must be able to reset for the next student
Must cover all arithmetic operations (+-*/)
Validation (name has to be in string) (answers have to be real/integers)
Questions must be appropriate for their age
Score the questions
Questions must be clear and easy to understand

3 | Page

A453 Programming task

Name: Liam Jones

Techniques
For this task, I will be using python 2.7 as a high-level language and I have thought
about what techniques I will need to use this includes:
Variables something that will change, I will be using variables for answering
the test and as conditioning/validation. Like when I question = 0 #setting all
varibles to be empty and clear before the program runs
Iteration loop validation, to loop until answer is within validation ranges.
Like when I while question < 11: #this while loop will make sure that the
program underneath runs till the variable reaches a certain value
Constant - something that will stay the same (name, etc.). Like when I NAME
= raw_input("Please type your name here: ") #i set name input as a
constant (a value that stays the same) because throughout the time the
program is running the name will not change
Conditioning validate sequence. Like when I else: #if not the correct
answer to the question then it will display the following
print "Incorrect,the correct answer = " + str(correct_answer) + "."
#tells you if you are incorrect and gives correct answer
Score - to mark questions right or wrong and mark accordingly and to count
and remember correct answers. Like when I marks = marks + 1 #adds 1 to
the mark variable
Operator - to use characters, such as (+/*-). Like when I if operater_1 == 3:
# if operater_3 equals 3 the this loop becomes in action
print str(unit_1) + " - " + (unit_2) #adds 1 to the question variable so
that only 10 questions are asked no matter what generates the sum
question = question + 1 #adds 1 to the question variable so that only
10 questions are asked no matter what
answer = input()#user input for question
correct_answer = unit_1 - unit_2#program works out correct answer
Integers - number based answers (validation). Like when I unit_2 =
random.randint (1,10)
Functions to create functions such as random and time. Like when I import
time #imports functions for the possibility for time which allows you to create
stops in the program
Logic and or Not. Like when I while question < 11:

4 | Page

A453 Programming task

Name: Liam Jones

Variable table
Variable name
answers

Data type
Alphanumeric
Numbers

gender

Boolean, yes/no

question

String

correct_answer

String

unit_1

Sting

unit_2

String

operater_1

string

marks

String

Role
To answers
the math
questions
To input
gender
Works out how
many
questions
have been
asked
Counts the
amount of
correct answer
Is the variable
that stores the
random
integers
Is the variable
that stores the
random
integers
Randomly
generates the
numeric
operator
Gives the
players there
marks

validation
To stop players from
entering words in
number questions
Male/female
Can only be changed
by program

To make sure the


players marks are
correctly outputted
Cannot be edited by
user

Cannot be edited by
user

Cannot be edited by
the user

Can only be changed


by the program

5 | Page

A453 Programming task

Name: Liam Jones

Test plan
Success criteria

How tested

The program
must be able to
generate maths
quiz

Run vigorously and


must be able to
generate 10
random questions
not repeating
Input name of 10
characters,15
characters and
tested to see if
remembered
create random
integers when run

to ask and
remember
students name

Must have a
range of
random integer
Must Not have
repetitive
questions
The programs
able to mark
questions and
put right
answers
Must be able to
reset
Must cover all
arithmetic
operations(+-x)
Validation
(name has to be
in string)
( answers have
to be
real/integers)
Questions must
be appropriate
for their age
Score the
questions
Questions must
be clear and
easy to
understand

Run to see if any


questions repeat in
a row
Run to see if it
marks question
correct and puts
rights answer

Expected
outcome
Will generate
the 10
questions
randomly

Actual outcome

Action

Will remember
name and
allow long
names
Will create
random
integers
Will not repeat

Will mark
correct and
put right
answer

Run and reset

Will reset

Run 3 times to see


if all operations are
used
Will be tested by
putting word
answers in number
questions and
numbers in word
questions
Run and tested for
too difficult
questions
Run and scored
manually and by
the program
Run and tested to
see if questions
make sense and
are easy to
understand

Will use all the


operations
Validation will
work and only
appropriate
will be allowed
to be inputted
Will not create
too difficult
questions
Will score
questions
The question
will be easy to
understand
and make
sense
6 | Page

A453 Programming task

Name: Liam Jones

7 | Page

A453 Programming task

Name: Liam Jones

Flow chart

8 | Page

A453 Programming task

Name: Liam Jones

Pseudo code
Start
Input time
Input

random

Input = name
Character = check
Output =
Set question =

instructions/guide
0

Set mark = 0
While

question < 10:

+) + random
Input

Output = random integers (1-10) + random character (*-/


integers (1-10)
= answer
Character = check
Answer check

If correct

question +1 mark +1
Repeat program

branching
Else

incorrect question +1
Repeat program

Elif question

= 10

Output
marks
End
Pseudo code is
a high-level
language that is
not linked to any
pseudo code is used to help plan

coding language. The


out the process that the code will
9 | Page

A453 Programming task

Name: Liam Jones

follow, including decisions, technique and variables. Doing pseudo code helps me
know what the aim of my code is and makes it easier for me to create the code.
Indentation in the code is called branching this represents the fact that the code
cannot continue without completing the branch.

10 | P a g e

A453 Programming task

Name: Liam Jones

Development and testing

11 | P a g e

A453 Programming task

Name: Liam Jones

Test
Success criteria

How tested

Expected
outcome
Will generate
the 10
questions
randomly

Actual outcome

The program
must be able to
generate maths
quiz

Run vigorously and


must be able to
generate 10
random questions
not repeating
Input name of 10
characters,15
characters and
tested to see if
remembered
create random
integers when run

Will remember
name and
allow long
names

Remembered
name and
allowed long
names

Will create
random
integers
Will not repeat

Randomly
created integers

Will mark
correct and
put right
answer

Marked correctly
and put right
answer

Run and reset

Will reset

Must cover all


arithmetic
operations(+-x)
Validation
(name has to be
in string)
( answers have
to be
real/integers)
Questions must
be appropriate
for their age

Run 3 times to see


if all operations are
used
Will be tested by
putting word
answers in number
questions and
numbers in word
questions
Run and tested for
too difficult
questions

Will use all the


operations

Ran and did not


reset but shut
down
All operators
used

Score the
questions

Run and scored


manually and by
the program
Run and tested to
see if questions

Will score
questions

to ask and
remember
students name

Must have a
range of
random integer
Must Not have
repetitive
questions
The programs
able to mark
questions and
put right
answers
Must be able to
reset

Questions must
be clear and

Run to see if any


questions repeat in
a row
Run to see if it
marks question
correct and puts
rights answer

Generated the
10 questions
randomly

Did not repeat

Validation will
work and only
appropriate
will be allowed
to be inputted

Answers were
only integers

Will not create


too difficult
questions

Did not create


too difficult
questions apart
from negative
questions
Scored question

The question
will be easy to

Action

Try to input a
restart loop

Did not
approach
stopping
negative
questions

The questions
were easy to
12 | P a g e

A453 Programming task


easy to
understand

make sense and


are easy to
understand

Name: Liam Jones


understand
and make
sense

understand and
made sense

13 | P a g e

A453 Programming task

Name: Liam Jones

Evidence of program working

My test runs, asks for name and displays instructions it then displays ten questions
one by one and says whether u are correct or incorrect if in the case you are
incorrect it displays the correct answer at the end of the program it displays how
many questions you got correct.

14 | P a g e

A453 Programming task

Name: Liam Jones

Conclusion
My program work for task one in the way I wanted it to. The program asks ten questions of
different arithmetic operations and random integers, this worked very well but their problem
trying to stopping negative questions and I did not approach fixing this error in the program,
also I had a problem with the programs restart loop. I tried to implement a restart loop but it
just caused my program to fail and give errors, which I did not have time to fix so I removed
it completely and left it working.
My program fulfils most of my success criteria apart from a few points which I was unable to
test or fix such as the stopping questions that required answers that were negative numbers
which I did not try and fix because of the time zone we had and the unclearly of how to
approach fixing that problem.

The program must be able to generate maths questions my program successfully


generates 10 questions before ending.

Must be able to ask and remember students name the quiz has variable that allows
the program to remember students names.

Must have a range of random integers the integers are randomly generated,
ranging between 1 and 10.

Must not have repetitive questions there is no validation for this because

The programs able to mark questions and put right answers the program marks
and checks the answer and marks it on whether it is correct or not.

Must be able to reset for the next student the program does not reset and requires
the program to reboot in order to reset.

Must cover all arithmetic operations (+-*/) the program uses all the operation but
division because the user cannot enter decimal point numbers because the program
cannot register numbers less than one.

Validation (name has to be in string) (answers have to be real/integers) - my program


uses multiple sets of validation to prevent the program failing or developing an error.

Questions must be appropriate for their age - questions are limited to only integers
between 1 and 10.

Score the questions - works out a score at the end.

Questions must be clear and easy to understand - all questions are laid out in a very
simple clear understandable way.

15 | P a g e

A453 Programming task

Name: Liam Jones

The problem with task 1 is that it runs off volatile memory Aka the RAM, this means that the
names and results collected by the quiz are lost as soon as the program is shutdown this is
fix in task 2 where the results are sorted.
Task 1 is the starting of the other two tasks, creating the quiz that is needed for the other two
to function.

16 | P a g e

A453 Programming task

Name: Liam Jones

A453 Programming task 2


Name: Liam Jones
Centre Number: 58313
Candidate Number:

17 | P a g e

A453 Programming task

Name: Liam Jones

Contents
3. Introduction
4. Task 2
a) Analysis
b) Success criteria
c) Programming techniques
d) Variables and validation
e) Test plan
f) Algorithms
g) Development evidence
h) Testing
i) Conclusion

18 | P a g e

A453 Programming task

Name: Liam Jones

Introduction
Task 2
The teacher wants to keep track of the scores each member of the class obtains in
the quiz. There are
Three classes in the school and the data should be kept separately for each class.
Analyse the requirements in detail for this program and design, code, test and
evaluate a program that will record and store the data for three separate classes of
students using the arithmetic quiz.

Success criteria

The program must be able to generate 10 maths quiz


Must be able to ask and remember students name
Must have a range of random integer
Must not have repetitive questions
The programs able to mark questions and put right answers
Must be able to reset
Must cover all arithmetic operations (+-*)
Validation (name has to be in string) (answers have to be real/integers)
Questions must be appropriate for their age
Score the questions
Questions must be clear and easy to understand

The programme will also log the users name, age and form/class
The programme will allocate the scores gained by the students to the folder
associated with their form
Will record and store the data for three separate classes

19 | P a g e

A453 Programming task

Name: Liam Jones

Techniques
For this task, I will be using python as a high-level language and I have thought
about what techniques I will need to use this includes:
Variables something that will change, I will be using variables for answering
the test and as conditioning/validation. Like when I question = 0 #setting all
varibles to be empty and clear before the program runs
Iteration loop validation, to loop until answer is within validation ranges.
Like when I while question < 11: #this while loop will make sure that the
program underneath runs till the variable reaches a certain value
Conditioning validate sequence. Like when I else: #if not the correct
answer to the question then it will display the following
print "Incorrect,the correct answer = " + str(correct_answer) + "."
#tells you if you are incorrect and gives correct answer
Score - to mark questions right or wrong and mark accordingly and to count
and remember correct answers. Like when I marks = marks + 1 #adds 1 to
the mark variable
Operator - to use characters, such as (+*-). Like when I if operater_1 == 3: #
if operater_3 equals 3 the this loop becomes in action
print str(unit_1) + " - " + (unit_2) #adds 1 to the question variable so
that only 10 questions are asked no matter what generates the sum
question = question + 1 #adds 1 to the question variable so that only
10 questions are asked no matter what
answer = input() #user input for question
correct_answer = unit_1 - unit_2#program works out correct answer
Integers - number based answers (validation). Like when I unit_2 =
random.randint (1,10)
Functions to create functions such as random and time. Like when I import
time #imports functions for the possibility for time which allows you to create
stops in the program
Logic and or Not. Like when I while question < 11:
Write writes over the stored information. Like when I
log_maths_quiz.write(name) #this writes the value that is asigned to 'name'
in to the text file
Append add to the information. Like when I log_maths_quiz =
open('log_10c1.txt', 'a+') #creates or opens the file under the name inside of
the brackets if the file does not exist then it is created

20 | P a g e

A453 Programming task

Name: Liam Jones

Variable table
Variable name
answers

Data type
Alphanumeric
Numbers

Role
To answers
the math
questions
To input
gender
To input name

validation
To stop players from
entering words in
number questions
Male/female

gender

Boolean, yes/no

name

Text

arithmetic_operators

String

Plays a role in
the question

write

Information storage

logging

Text and string

append

Information storage

read

Information storage

Overwrites
information
To record the
users name
and score
Adds to
information
Reads the
stored
information

To make sure
operator does on
repeat
Stores information
once
Logs name and score

text based input, no


inappropriate
inputs

Adds to the stored


information
Reads the
information stored in
the folders

21 | P a g e

A453 Programming task

Name: Liam Jones

Test plan
Success criteria

How tested

The program
must be able to
generate maths
quiz

Run vigorously and


must be able to
generate 10 random
questions not
repeating
Input name of 10
characters,15
characters and tested
to see if remembered
create random
integers when run

to ask and
remember
students name
Must have a
range of random
integer
Must Not have
repetitive
questions
The programs
able to mark
questions and put
right answers
Must be able to
reset
Must cover all
arithmetic
operations(+-x)
Validation (name
has to be in
string)( answers
have to be
real/integers)
Questions must
be appropriate for
their age
Score the
questions
Questions must
be clear and easy
to understand
to Be able to read
the stored results

Log names and


data scores

Expected
outcome
Will generate
the 10
questions
randomly

Action

Will remember
name and allow
long names
Will create
random integers

Run to see if any


questions repeat in a
row
Run to see if it marks
question correct and
puts rights answer

Will not repeat

Run and reset

Will reset

Run 3 times to see if


all operations are
used
Will be tested by
putting word answers
in number questions
and numbers in word
questions
Run and tested for
too difficult questions

Will use all the


operations

Run and scored


manually and by the
program
Run and tested to
see if questions make
sense and are easy
to understand
Will be run and file
logged with
information then the
information will be
attempted to be read
Run, complete test
and check over and
over

Actual outcome

Will mark
correct and put
right answer

Validation will
work and only
appropriate will
be allowed to
be inputted
Will not create
too difficult
questions
Will score
questions
The question
will be easy to
understand and
make sense
Will be able to
be read

Will run and


recorded

22 | P a g e

A453 Programming task

Name: Liam Jones

23 | P a g e

A453 Programming task

Name: Liam Jones

Flow chart

24 | P a g e

A453 Programming task

Name: Liam Jones

Pseudo code
Start
Input time
Input random
Input = name
Input = form
Open file = dependent on form
Character = check
Output = instructions/guide
Set question = 0
Set mark = 0
Output = random integers (1-99) random string (*-/+) random integers (1-99)
Input = answer
Character = check
Answer check
If correct question +1 mark +1
Repeat program
Else incorrect question +1
Repeat program
Elif question = 10

Start
test

Output marks
Saves marks to file
End

25 | P a g e

A453 Programming task

Name: Liam Jones

Test
Success criteria

How tested

The program
must be able to
generate maths
quiz

Run vigorously and


must be able to
generate 10 random
questions not
repeating
Input name of 10
characters,15
characters and tested
to see if remembered

to ask and
remember
students name

Expected
outcome
Will generate
the 10
questions
randomly

Actual outcome

Will remember
name and allow
long names

Generated the
10 questions
randomly

Must have a
range of random
integer
Must Not have
repetitive
questions
The programs
able to mark
questions and put
right answers
Must be able to
reset

create random
integers when run

Will create
random integers

Remembered
name and
allowed long
names
Randomly
created integers

Run to see if any


questions repeat in a
row
Run to see if it marks
question correct and
puts rights answer

Will not repeat

Did not repeat

Will mark
correct and put
right answer

Marked correctly
and put right
answer

Run and reset

Will reset

Must cover all


arithmetic
operations(+-x)
Validation (name
has to be in
string)( answers
have to be
real/integers)
Questions must
be appropriate for
their age

Run 3 times to see if


all operations are
used
Will be tested by
putting word answers
in number questions
and numbers in word
questions
Run and tested for
too difficult questions

Will use all the


operations

Ran and did not


reset but shut
down
All operators
used

Score the
questions

Run and scored


manually and by the
program
Run and tested to
see if questions make
sense and are easy
to understand

Will score
questions

Will be run and file


logged with
information then the
information will be

Will be able to
be read

Questions must
be clear and easy
to understand
to Be able to read
the stored results

Validation will
work and only
appropriate will
be allowed to
be inputted
Will not create
too difficult
questions

The question
will be easy to
understand and
make sense

Action

Try to input a
restart loop

Answers were
only integers

Did not create


too difficult
questions apart
from negative
questions
Scored question

Did not
approach
stopping
negative
questions

The questions
were easy to
understand and
made sense
Is able to log
information in
correct form and is
able to be read at

Did not
approach
repeats

26 | P a g e

A453 Programming task

Name: Liam Jones

attempted to be read
Log names and
data scores

Run, complete test


and check over and
over

a later date
Will run and
recorded

Is able to log name


In correct form and
the maths quiz
score as well

Development and testing

27 | P a g e

A453 Programming task

Name: Liam Jones

My test runs, asks for name and form then displays instructions it
then displays ten questions one by one and says whether u are
correct or incorrect if in
the case you are incorrect it displays the correct answer at the end of the
program it displays how many questions you got correct.

28 | P a g e

A453 Programming task

Name: Liam Jones

Conclusion
During task 2 I found the most difficult part about it was the learning of the new data
logging code, the easiest part was implementing the newly learnt code in to my
previously created code. My code work is, as the task wants it to logging the pupils
scores and name in the correct form folder as the task asked of the code. I ran in to
a few problems with the organisation of the files and many syntax errors because of
miss understandings in my code. I overcame every problem, my code originally was
over complicated and long I compressed it down and included many separate points
into one and that reduced my code down, reduced the possibility of errors, and made
the errors easier to see. This helps me improve my program and complete more
units of my success criteria but still had problems with certain aspects of my success
criteria such as approaching negative questions and repeating results from the same
user.

The program must be able to generate 10 maths questions the


program continues to successes in this task very well and produces 10 maths
questions.

Must be able to ask and remember students name the program


askes and stores users names in a .TXT file.

Must have a range of random integers it randomly produces integers


between 1 and 10.

Must not have repetitive questions have not set up validation for this
based on the fact that the possibility of a question repeating in very slim.

The programs able to mark questions and put right answers my


program performs the sum its self and works out the correct answer before
marking the users answer

Must be able to reset the program requires a reboot in order to reset

Must cover all arithmetic operations (+-*/) the program uses all
operations

Validation (name has to be in string) (answers have to be real/integers)


my program uses multiple sets of validation to prevent the program failing or
developing an error

29 | P a g e

A453 Programming task

Name: Liam Jones

Questions must be appropriate for their age questions are limited to


only integers between 1 and 10
Score the questions works out a score at the end

Questions must be clear and easy to understand all questions are


laid out in a very simple clear understandable way

The programme will also log the users name, age and form/class the
program logs users names score and form

The programme will allocate the scores gained by the students to the
folder associated with their form the program allocates the users to the
correct form

Will record and store the data for three separate classes the program
will record the data

30 | P a g e

A453 Programming task

Name: Liam Jones

A453 Programming task 3


Name: Liam Jones
Centre Number: 58313
Candidate Number:

31 | P a g e

A453 Programming task

Name: Liam Jones

Contents
5. Introduction
6. Task 3
a) Analysis
b) Success criteria
c) Programming techniques
d) Variables and validation
e) Test plan
f) Algorithms
g) Development evidence
h) Testing
i) Conclusion

32 | P a g e

A453 Programming task

Name: Liam Jones

Introduction
Task 3
The teacher wants to use the results from students taking these quizzes to log their
performance. The system should store the last three scores for each student. The
teacher would like to be able to output the results of the quiz for a particular class,
sorted: in alphabetical order with each students highest score for the tests, by the
highest score, highest to lowest, by the average score, highest to lowest. Analyse the
requirements in detail for this program and design, code, test and evaluate a
program that will allow the teacher to select which class group to look at and which
field to use when sorting the output data.
In the previous two tasks Ive created programs that have run a maths quiz that
creates adding, subtracting, multiplication and division sums at random with random
integers however while we are still creating a quiz for task 3 the previous solutions
will not be suitable because in the previous tasks a .txt file was used and this would
not be compatible with task 3 because task 3 requires you to store the last 3 scores
of each student, sort in alphabetical order, by the highest score (highest to lowest)
and by average score (highest to lowest) this would not be able to be done in a .txt
file. Therefore, I would have to use a .csv file because this would allow me to do
things that a .txt file would not allow. For this task, I will also be introducing a GUI
(graphic user interface) to make the program more user friendly and easier to use.

Success criteria

Must be able to reset


Validation (name has to be in string) (answers have to be real/integers)
The programme will allocate the scores gained by the students to the
folder associated with their form and name
Will store the students last 3 scores
Store in alphabetical order with each students highest score for the test
By the highest score, highest to lowest
By the average score, highest to lowest
Save to a csv file

Techniques
33 | P a g e

A453 Programming task

Name: Liam Jones

For this task, I will be using python, as a high-level language my program will be
using variables to state the amount of questions done and questions needed to be
done. Variables will also be used to record, store and show the score at the end. I
will be using loops in my program for validation so that users can only input valid
data such as integers (numbers) and string (letters and symbols) and not cause
errors in the program. I will be using constants to establish the same data throughout
such as names. I will be including operators into my program to make my
mathematic questions be more users friendly. I will be using functions such as
random to get random integers and operators also; I will be using GUI function in
order to make the quiz more users friendly.
Variables something that will change, I will be using variables for answering
the test and as conditioning/validation. Like when I question = 0 #setting all
varibles to be empty and clear before the program runs
Iteration loop validation, to loop until answer is within validation ranges.
Like when I while question < 11: #this while loop will make sure that the
program underneath runs till the variable reaches a certain value
Conditioning validate sequence. Like when I
Functions to create functions such as random and time. Like when I import
time #imports functions for the possibility for time which allows you to create
stops in the program
Logic and or Not. Like when I while choice == 0: # a while loop that set
continues while the variable choice is equal to 0
Append used to add to information. newlist.append(row[0:3]) # gives the
range of cells that will be edited
Csv file printing - for row in csv_f:
print row #prints csv file

34 | P a g e

A453 Programming task

Name: Liam Jones

35 | P a g e

A453 Programming task

Name: Liam Jones

Variable table
Variable name
Answers

Data type
Alphanumeric
Numbers

Role
To answers
the math
questions
To input
gender
To input name

validation
To stop players from
entering words in
number questions
Male/female

Gender

Boolean, yes/no

Name

text

Arithmetic operators

string

Plays a role in
the question

Write

Information storage

Logging

Text and string

Append

Information storage

Read

Information storage

Name of class

String

Score

Integer

Quiz questions

Integers and string

Correct answers

String

Overwrites
information
To record the
users name
and score
Adds to
information
Reads the
stored
information
To open the
corresponding
form file
To recorded,
store and
display the
score
Puts out the
correct
number of
question
Program can
work out
correct
answers

To make sure
operator does on
repeat
Stores information
once
Logs name and score

text based input, no


inappropriate
inputs

Adds to the stored


information
Reads the
information stored in
the folders
Opens and Stores in
correct folder
Make sure the final
score is accurate

Makes sure the


correct number of
questions is output
Make sure the
program tell the
difference between
correct and incorrect
answers

36 | P a g e

A453 Programming task

Name: Liam Jones

Test plan
Success criteria

How tested

The program
must be able to
generate maths
quiz

Run vigorously and


must be able to
generate 10 random
questions not
repeating
Input name of 10
characters,15
characters and tested
to see if remembered
create random
integers when run

to ask and
remember
students name
Must have a
range of random
integer
Must Not have
repetitive
questions
The programs
able to mark
questions and put
right answers
Must be able to
reset
Must cover all
arithmetic
operations(+-x)
Validation (name
has to be in
string)( answers
have to be
real/integers)
Questions must
be appropriate for
their age
Score the
questions
Questions must
be clear and easy
to understand
to Be able to read
the stored results

Log names and


data scores

Expected
outcome
Will generate
the 10
questions
randomly

Action

Will remember
name and allow
long names
Will create
random integers

Run to see if any


questions repeat in a
row
Run to see if it marks
question correct and
puts rights answer

Will not repeat

Run and reset

Will reset

Run 3 times to see if


all operations are
used
Will be tested by
putting word answers
in number questions
and numbers in word
questions
Run and tested for
too difficult questions

Will use all the


operations

Run and scored


manually and by the
program
Run and tested to
see if questions make
sense and are easy
to understand
Will be run and file
logged with
information then the
information will be
attempted to be read
Run, complete test
and check over and
over

Actual outcome

Will mark
correct and put
right answer

Validation will
work and only
appropriate will
be allowed to
be inputted
Will not create
too difficult
questions
Will score
questions
The question
will be easy to
understand and
make sense
Will be able to
be read

Will run and


recorded

37 | P a g e

A453 Programming task

Name: Liam Jones

The programme
will allocate the
scores gained by
the students to
the folder
associated with
their form and
name
Will record and
store the data for
three separate
classes

The folders in
question will be
opened and
examined to see if
the information is
located where it is
meant to be

The information
is stored in
correct location
in correct format

Correct File will be


opened to find out if
information is there

Store in
alphabetical order
with each
students highest
score for the test
By the highest
score, highest to
lowest

The file will be


checked to see if it is
stored in alphabetical
order

The information
recorded will be
stored in correct
corresponded
file
The file will be
able to be
stored
alphabetically

Save to a csv file

The file will be found


and checked to see if
it is in the correct
format

The file will be


checked to see if it is
stored in highest to
lowest order

The file will be


able to be
sorted from
highest to
lowest
The information
gained from test
is saved to a
csv file

38 | P a g e

A453 Programming task

Name: Liam Jones

Flow charts
Quiz subroutine

39 | P a g e

A453 Programming task

Name: Liam Jones

File creation and


opening
subroutine

40 | P a g e

A453 Programming task

Name: Liam Jones

Evidence of errors
I had a print loop error in which multiple of the same detail would be displayed I fixed this by
moving the print function

41 | P a g e

A453 Programming task

Name: Liam Jones

Pseudo code
Import csv, time, sys
While selectclass == 0:
Selectclass = raw_input (please selectclass )
If class is 1
open class 1
If class is 2
open class 2
If class is 3
open class 3
while choice == 0:
print select option 1,2,3,4
if choice == 1:
print scores
elif choice ==2:
print average score
elif choice ==3:
print max score
elif choice ==4
print min score

42 | P a g e

A453 Programming task

Name: Liam Jones

Development and testing

43 | P a g e

A453 Programming task

Name: Liam Jones

my program runs and asks for the form you wish to view then gives you 4 options on
what to do with the results in the picture I have shown the scores. The program
displays the scores and then gives you the option to see the options again; I said no
and asked the program to end.

44 | P a g e

A453 Programming task

Name: Liam Jones

Conclusion
For task 3, I had to approach the programing from a different angle, because the
ways the sorting and saving the results interacted with the quiz so I took step back
and revisited the task that was set, and realized that the quiz was not asked to be
included in the program so I removed it completely and stuck to completing strictly
what the task asked me to do. Which was to have a program that could store and
sort results, which my program does.
Task 3 differs from the other two tasks because it utilises a record database (DBMS,
database management system. Captures and analyses data), its a record database
because there are multiple fields (basic unit of data) the fields are name, score,
maximum, minimum and average. Storing information like this is far more organised
and efficient for sorting and manipulating.
My program completes most of my success criteria with only a few minor problems
that could have been resolved with more time and a second set of eyes to spot
obvious bugs (software error, flaw or fault that causes an incorrect or unexpected
result)

Must be able to reset the program resets and goes back to the
original multi choice menu.

Validation (name has to be in string) (answers have to be


real/integers) my program asks the user for the form results
they wish to view and has validation to make sure that they enter
a one of the 4 options correctly.

The programme organises and be able to display students


results and names the program organises the results perfectly
and displays the information in an understandable way.

Will store the students last 3 scores the program stores and
displays the last 3 scores and organises based on the 3 scores.

Store in alphabetical order with each students highest score for


the test my program unfortunately does not sort alphabetically
in the simple fact that I did not implement I this function because
of time restrictions and unknowing of how to approach this task.

45 | P a g e

A453 Programming task

Name: Liam Jones

By the highest score, highest to lowest my program sorts


highest to lowest scores and also lowest to highest fulfilling these
criteria and more.

By the average score, highest to lowest the program takes and


average of all 3 scores and saves to the csv file.

Save to a csv file the program organises and saves the results
to the csv file also retrieving the information from the csv file.

46 | P a g e

S-ar putea să vă placă și