+ All Categories
Home > Documents > A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ......

A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ......

Date post: 27-Mar-2018
Category:
Upload: buidung
View: 243 times
Download: 0 times
Share this document with a friend
30
GCSE Computing Exemplar Candidate Work J275 Unit A453 Sample Material C1 Version 1 www.ocr.org.uk/gcsecomputing Computing
Transcript
Page 1: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

GCSE

ComputingExemplar Candidate WorkJ275

Unit A453 Sample Material C1

Version 1

www.ocr.org.uk/gcsecomputing

Computing

Page 2: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

2 © OCR 2015

Disclaimer on use of Sample MaterialConfidentialityThese tasks are taken from legacy Controlled Assessment tasks, undertaken and submitted by candidates. Where possible, we have removed all identifying information from these assessments. Should any data remain, you are requested to treat this confidentially and inform OCR as soon as possible highlighting the data concerned.

Use of URS Sheets and Sample MaterialThese tasks have all been moderated as part of the relevant exam series in which they were submitted and the marks submitted have all been allowed to stand. However, schools should bear in mind that this only indicates that the overall assessment of the Controlled Assessment is within tolerance and not necessarily each individual mark band. There may be instances where the mark scheme has been applied too generously, or similarly too harshly. This would have been identified in the reports to the centre – but will not be evident from URS alone. The spirit of the release of these samples is to give teachers better understanding of what High, Medium and Low graded coursework would feel like as an entity, rather than exact definitions of requirements for mark bands independently.

The provision of high graded work should not infer that this is the only, or best way of writing up a Controlled Assessment Task. Candidates are encouraged to map their personal journey through the tasks. Writing frames, or ‘guides’ for documentation are against the spirit of the coursework and constitute malpractice.

Each set of materials released contains a High, Middle and Low grade band. This should allow teachers to gain good understanding of the general standard of work quality required for each mark band, and as a whole – especially when comparing each set side by side.

Teachers are encouraged to seek further support when they feel clarification is needed in applying the mark scheme. We would also recommend regular CPD in respect of Controlled Assessment delivery and marking.

AccuracyAll work has, where possible, remained unaltered from the original submission. There may well be grammatical errors and poor layout in diagrams. This is to allow better matching of mark band criteria, where specific bullet points refer to quality of Spelling, Punctuation and Grammar, and also ease of navigation etc. Any significant changes are clearly marked. Some data that is perceived sensitive may be blocked out in black.

Page 3: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

3 © OCR 2015

Page 4: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

4 © OCR 2015

Page 5: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

5 © OCR 2015

Page 6: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

6 © OCR 2015

A453 Task 1What I’m going to do. Create program that simulates a roll of a 4, 6 or 12 sided dice. The user will pick what dice is to be thrown the program will then output the result of the throw. This will be able to be done as many time as required.

Success Criteria• The system should display a choice of a 4, 6 or 12 die.

• The user will then be able to choose which die that will be rolled

• The system will then ‘roll’ the chosen die

• The output of die chosen and the die roll will then be displayed

• The process will then be able to be repeated

Flow chart

Page 7: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

7 © OCR 2015

Pseudo Code4 sided die clickedDice = 4No = random number between 1 and 4Output “Dice” & (Dice) & “Has been chosen. The result was “ & (No) 6 sided die clickedDice = 6No = random number between 1 and 6Output “Dice” & (Dice) & “Has been chosen. The result was “ & (No) 12 sided die clickedDice = 12No = random number between 1 and 12Output “Dice” & (Dice) & “Has been chosen. The result was “ & (No)

Test plan

What I’m testing How I will test it Expected OutputThat the 4 sided die works Click 4 sided die “The 4 sided dice has been rolled.” &

A number between 1 and 4That the 6 sided die works Click 6 sided die “The 6 sided dice has been rolled.” &

A number between 1 and 6That the 12 sided die works Click 12 sided die “The 12 sided dice has been rolled.” &

A number between 1 and 12That the user can use the program as many time as desired

Click the dice randomly for 60 seconds

No crashes

Variables• No = this will store the number generated locally ready for output. (Integer)

• Die = This will store the dice chosen. (Integer)

• Ran = This is where the random number will be generated (As New random)

ValidationThe will be no way to enter an invalid input as the only input methods will be the selection buttons.

Page 8: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

8 © OCR 2015

Development

Page 9: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

9 © OCR 2015

Testing

Page 10: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

10 © OCR 2015

Criteria Check

Overall my system met my success criteria, passed all of my system tests and was simple to use and interact with so, overall was a successes although I could improve it by making the interface more engaging by, for example making an visual dice to output the result.

Full CodePublic Class Form1 ‘These are the declaed variables Dim Ran As New Random() Dim No As Integer Dim Dice As Integer ‘This is the roll code for the 4 sided dice Private Sub die1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles die1.Click Dice = 4 No = Ran.Next(1, 5) ‘This will generate a randome number between 0 and 4 Output.Text = “The “ & Dice & “ sided dice has been chosen. The result was “ & No End Sub‘This is the roll code for the 6 sided dice Private Sub die2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles die2.Click Dice = 6 No = Ran.Next(1, 7) ‘This will generate a randome number between 0 and 6 Output.Text = “The “ & Dice & “ sided dice has been chosen. The result was

Page 11: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

11 © OCR 2015

“ & No End Sub ‘This is the roll code for the 12 sided dice Private Sub die12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles die12.Click Dice = 12 No = Ran.Next(1, 13) ‘This will generate a randome number between 0 and 12 Output.Text = “The “ & Dice & “ sided dice has been chosen. The result was “ & No End Sub

Page 12: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

12 © OCR 2015

Task 2What I’m going to do.I’m going to make the start of a game with two characters who each have two attributes ,strength and skill. These will be determined by a 4 and 12 sided dice being rolled then the value of the 12 sided dice will be divided by the value of the 4 sided dice. The result will then be rounded down then added to the initial attribute value of 10. This will be repeated for each attribute for each character. The game will then store a sample of the two attributes for both characters to a text file.

Success Criteria• At the start of the game a 4 and 12 sided dice are rolled

• The value of the 12 sided dice is divided by the value of the 4 sided dice.

• The result will be rounded down then added to the initial attribute value of 10.

• The calculation is repeated while setting the results to the attributes corresponding variable

• The results are outputted to the text file

Flow chart

Page 13: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

13 © OCR 2015

Pseudo CodeForm loadX=0Do Until x = 4No1 = Random number between 1 and 4 generatedNo2 = Random number between 1 and 12 generatedAttribute(x) = Math.Floor(No2/No1)X = X + 1Loop Output all the attribute values to a text file

VariablesFilename StringAttribute(0 To 3) Single = The array to store the attribute valuesNo1 Integer = This to store the 1st random numbers generatedNo2 Integer This to store the 2nd random numbers generatedX Integer = This to store the number the loop usesran1 Random= The random number generator

Test plan

What I’m testing How will I test it Expected outputThat the random numbers generated are random

By running the program multiple times then consulting the text file

A random number between 1 and 4 each time and A random number between 1 and 12

That the program divides the numbers correctly

By running the program multiple times then consulting the text file

Testing numbers close, far away and the same as each other

The correct answer to the division

That the result from the division is rounded down correctly

By running the program multiple times then consulting the text file

The answer to the division correctly rounded down

That the result is added to 10 correctly By running the program multiple times then consulting the text file

The result correctly added to 10 correctly

The results of the operations are outputted to the text file correctly

By running the program multiple times then consulting the text file

The results of the operations are outputted to the text file correctly

Page 14: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

14 © OCR 2015

Development

Page 15: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

15 © OCR 2015

Page 16: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

16 © OCR 2015

Testing

Page 17: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

17 © OCR 2015

The program was very successful as all the success criteria was met and the program does exactly what the specification states although the program could be improved if you could choose the difficulty at the start of the game that would make the range of random numbers generated larger therefore making the attribute values vary more.

Public Class Form1 ‘This is declartion of the text file and the opening of it Dim Filename As String = “Stats.txt” Dim objreader As New System.IO.StreamWriter(Filename, True) ‘This is the array to store the attribute values after they have been determined Dim Attribute(0 To 3) As Single ‘These are the variables to store the random numbers once they have been generated Dim No1 As Integer Dim No2 As Integer ‘This stores the number the loop uses to output to the array and to know when to stop Dim X As Integer ‘this is the randome number Dim ran1 As New Random Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Page 18: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

18 © OCR 2015

X = 0 objreader.WriteLine(“Start of a new game.”) objreader.WriteLine(“ “) ‘This is the loop that generates the attribute valuesDo Until X = 4 ‘Here the random numbers are generated No1 = ran1.Next(1, 5) No2 = ran1.Next(1, 13) ‘Below the calculation is done and the result is set to the next attribute Attribute(X) = Math.Floor(10 + (No2 / No1)) ‘Here I output each step to the text file objreader.WriteLine(“Below is the stat generation, broken down into each step for stat number “ & (X + 1)) objreader.WriteLine(“No1 was “ & No1) objreader.WriteLine(“No2 was “ & No2) objreader.WriteLine(“No2 Divided by No1 was “ & (No2 / No1)) objreader.WriteLine(“No2 Divided by No1 rounded down was “ & Math.Floor(No2 / No1)) objreader.WriteLine(“No2 Divided by No1 rounded down plus 10 was “ & 10 + Math.Floor(No2 / No1)) objreader.WriteLine(“ “) X = X + 1 Loop ‘After the loop is done all the attribute values are displayed to the user in 4 buttons in the form Button1.Text = Attribute(0) Button2.Text = Attribute(1) Button3.Text = Attribute(2) Button4.Text = Attribute(3) ‘The last thing done is outputting the actual attribute values to the text file objreader.WriteLine(“Character 1 skill was:” & Attribute(0)) objreader.WriteLine(“Character 1 strength was:” & Attribute(1)) objreader.WriteLine(“Character 2 skill was:” & Attribute(2)) objreader.WriteLine(“Character 2 strength was:” & Attribute(3)) objreader.WriteLine(“ “) objreader.WriteLine(“ “) objreader.WriteLine(“ “) objreader.WriteLine(“ “) ‘This closes the text file objreader.Close() End SubEnd Class

Page 19: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

19 © OCR 2015

Task 3What I’m going to doI’m going to make a program that determines the outcome of an encounter it will allow the user to input the strength and skill for the two characters. The program will then take those values put then though an algorithm to make a strength and skill modifier. A dice will then be rolled for each player the one with the highest dice roll will get the modifiers added to their respected attributes, the one with the lowest will get the modifiers subtracted from their respected attributes. If any characters skill becomes zero or negative it will be stored as zero. If any characters strength becomes zero or negative that character dies this will be the end of the game.

Success criteria• The program will allow the user to input the strength and skill for both character

• The difference between the strength attributes is calculated, divided by 5 and rounded down then stored as the strength modifier.

• The difference between the skill attributes is calculated, divided by 5 and rounded down then stored as the skill modifier.

• Both players can roll a 6 sided dice once

• The results of the dice rolls will be will be compared, if the results are the same nothing will change if the results are different the player with the highest dice roll will get the modifiers added to their respected attributes, the one with the lowest will get the modifiers subtracted from their respected attributes.

• If any characters skill becomes zero or negative it will be stored as zero.

• If any characters strength becomes zero or negative that character dies this will be the end of the game.

Flow chart

Page 20: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

20 © OCR 2015

Page 21: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

21 © OCR 2015

Pseudo CodeInput Stength1, Strength2, Skill1, Skill2If Strength1 > Strength2 then StrengthMod = (Strength1 - Strength2 \ 5)Else StrengthMod = (Strength2 – Strength1 \ 5) End ifIf Skill1 > Skill2 then SkillMod = (Skill1 - Skill2 \ 5)Else SkillMod = (Skill2 – Skill1 \ 5) End ifDice1 = random number between 1 and 6Dice2 = random number between 1 and 6If Dice1 > Dice2 then Strength1 = Strength1 + StrengthMod Strength2 = Strength2 – StrengthMod Skill1 = Skill1 + SkillMod Skill2 = Skill2 - SkillModElse Strength1 = Strength1 - StrengthMod Strength2 = Strength2 + StrengthMod Skill1 = Skill1 - SkillMod Skill2 = Skill2 + SkillModEnd ifIf Skill1 < 0 then Skill1 = 0End ifIf Skill2 < 0 then Skill2 = 0End ifIf Strength1 <= 0 then Output (Character1 Has Died)End ifIf Strength2 <= 0 then Output (Character2 Has Died)End if

Page 22: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

22 © OCR 2015

Variables

Variable name What is doesran Random This will generate the random numbersDice1 Integer

Dice2 Integer

These will store random numbers that are generated

Strength1 Integer

Strength2 Integer

Skill1 Integer

Skill2 Integer

These will store the entered attributes ready for the calculation and store the new attributes after the calculation

StrengthMod Integer

SkillMod Integer

These will store the calculated modifiers

Validation • No validation is needed as the user can only enter things already in the combo box’s

• All the numbers there are valid and require no validation.

Test Plan

What I’m testingIf the user can enter the strength and skill attributesThe difference between the strength attributes is calculated the divided by 5 and then rounded down then stored as the strength modifierThe difference between the Skill attributes is calculated the divided by 5 and then rounded down then stored as the skill modifierTwo dice are rolled for both character and compared. Whoever has the highest roll wins the encounterThe player that wins the dice roll gets the strength modifier added to their strength attribute and The player that wins the dice roll gets the skill modifier added to their skill attribute The player that loses the dice roll gets the strength modifier subtracted from their strength attribute and The player that loses the dice roll gets the skill modifier subtracted from to their skill attribute If any skill modifier becomes below zero it is changed to zeroif any strength modifier becomes 0 or below the character that it belongs to DiesIf the dice roll is the same it outputs as a draw

Page 23: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

23 © OCR 2015

Development

Page 24: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

24 © OCR 2015

Public Class Form1 ‘Here are the variables for the; the dice rolls ‘The player attributes ‘the Strength and Skill modifier ‘and the random number Dim Dice1 As Integer Dim Dice2 As Integer

Dim Strength1 As Integer Dim Strength2 As Integer Dim Skill1 As Integer Dim Skill2 As Integer

Dim StrengthMod As Integer Dim SkillMod As Integer

Dim ran As New Random()

Dim Filename As String = “Testing.txt”

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim objreader As New System.IO.StreamWriter(Filename, True)

objreader.WriteLine(“Start of a new game.”) objreader.WriteLine(“ “) objreader.WriteLine(“ “) ‘This sets the combo boxes value to 1 CB1.SelectedIndex = 0 CB2.SelectedIndex = 0 CB3.SelectedIndex = 0 CB4.SelectedIndex = 0

Page 25: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

25 © OCR 2015

objreader.Close() End Sub

‘This runs the algorithm to determine the outcome of the encounter Private Sub Run_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Run.Click Dim objreader As New System.IO.StreamWriter(Filename, True)

‘This sets the attribute variables to the players input Strength1 = CB1.Text Strength2 = CB3.Text Skill1 = CB4.Text Skill2 = CB2.Text

objreader.WriteLine(“Strength1 is “ & Strength1) objreader.WriteLine(“Strength2 is “ & Strength2) objreader.WriteLine(“Skill1 is “ & Skill1) objreader.WriteLine(“Skill2 is “ & Skill2) objreader.WriteLine(“ “)

‘This calculates the modifiers for the encounter If Strength1 > Strength2 Then StrengthMod = ((Strength1 – Strength2) \ 5) Else StrengthMod = ((Strength2 – Strength1) \ 5) End If objreader.WriteLine(“The StrengthMod is “ & StrengthMod)

If Skill1 > Skill2 Then SkillMod = ((Skill1 – Skill2) \ 5) Else SkillMod = ((Skill2 – Skill1) \ 5) End If objreader.WriteLine(“The SkillMod is “ & SkillMod) objreader.WriteLine(“ “)

‘This displays the modifiers StM.Text = (“The Strength Mod is “ & StrengthMod) SM.Text = (“The Skill Mod is “ & SkillMod)

‘Here the dice are rolled Dice1 = ran.Next(1, 7) Dice2 = ran.Next(1, 7) objreader.WriteLine(“Dice1 is “ & Dice1) objreader.WriteLine(“Dice2 is “ & Dice2) objreader.WriteLine(“ “)

Page 26: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

26 © OCR 2015

‘This is the dice comparison that calculates the new attributes If Dice1 > Dice2 Then objreader.WriteLine(“Dice1 is Greater than Dice2”) objreader.WriteLine(“ “) Strength1 = Strength1 + StrengthMod Strength2 = Strength2 – StrengthMod Skill1 = Skill1 + SkillMod Skill2 = Skill2 – SkillMod B1.BackColor = Color.Green B2.BackColor = Color.Red ElseIf Dice2 > Dice1 Then objreader.WriteLine(“Dice2 is Greater than Dice1”) Strength1 = Strength1 – StrengthMod Strength2 = Strength2 + StrengthMod Skill1 = Skill1 – SkillMod Skill2 = Skill2 + SkillMod B2.BackColor = Color.Green B1.BackColor = Color.Red Else MsgBox(“Draw”) End If

‘This calculates the out come and if either character dies If Skill1 < 0 Then Skill1 = 0 objreader.WriteLine(“Skill1 was equal or lower than zero”) End If If Skill2 < 0 Then Skill2 = 0 objreader.WriteLine(“Skill2 was equal or lower than zero”) End If

If Strength1 <= 0 Then Strength1 = 0 objreader.WriteLine(“Strength1 was equal or lower than zero so Charecter1 has died”) MsgBox(“Character1 Has Died”) End If If Strength2 <= 0 Then Strength2 = 0 objreader.WriteLine(“Strength2 was equal or lower than zero so Charecter2 has died”) MsgBox(“Character2 Has Died”) End If ‘This outputs the new attribute values Output1.Text = (“Player 1’ Strength is now “ & Strength1 & “ and the Skill is now “ & Skill1 & “.”) Output2.Text = (“Player 2’ Strength is now “ & Strength2 & “ and the Skill is now “ & Skill2 & “.”) objreader.WriteLine(“ “) objreader.WriteLine(“The new Strength1 is “ & Strength1)

Page 27: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

27 © OCR 2015

objreader.WriteLine(“The new Strength2 is “ & Strength2) objreader.WriteLine(“The new Skill1 is “ & Skill1) objreader.WriteLine(“The new Skill2 is “ & Skill2) objreader.WriteLine(“ “) objreader.WriteLine(“ “) objreader.Close() End Sub

End Class

Page 28: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

28 © OCR 2015

Testing

What I’m testing How I’m testing it Input Video that proves on the next slide

If the user can enter the strength and skill attributes

By trying to enter the attributes

Attribute values The Combo boxes that are used in Video 1

The difference between the strength attributes is calculated the divided by 5 and then rounded down then stored as the strength modifier

Running the program and consulting the text file and video

Strength 1 = 3

Strength 2 = 86

The expected outputted in the two buttons under strength modifier Video 1

The difference between the Skill attributes is calculated the divided by 5 and then rounded down then stored as the skill modifier

Running the program and consulting the text file and video

Skill 1 = 91

Skill 2 = 7

The expected outputted in the two buttons under Skill modifier Video 1

Two dice are rolled for both character and compared. Whoever has the highest roll wins the encounter

Running the program and consulting the text file and video

Fight button (Click) Player that wins tile turn green Video 1

The player that wins the dice roll gets the strength modifier added to their strength attribute and The player that wins the dice roll gets the skill modifier added to their skill attribute

Running the program and consulting the text file and video

Strength 1 = 3

Strength 2 = 86

Skill 1 = 91

Skill 2 = 7

Fight button (Click)

The expected outputs outputted to the new attributes label Video 1

The player that loses the dice roll gets the strength modifier subtracted from their strength attribute and The player that loses the dice roll gets the skill modifier subtracted from to their skill attribute

Running the program and consulting the text file and video

Strength 1 = 3

Strength 2 = 86

Skill 1 = 91

Skill 2 = 7

Fight button (Click)

The expected outputs outputted to the new attributes label Video 1

If any skill modifier becomes below zero it is changed to zero

Running the program and consulting the text file and video

Strength 1 = 3

Strength 2 = 86

Skill 1 = 91

Skill 2 = 7

Fight button (Click)

The expected outputs outputted to the new attributes label Video 1

if any strength modifier becomes 0 or below the character that it belongs to Dies

Running the program and consulting the text file and video

Strength 1 = 3

Strength 2 = 86

Skill 1 = 91

Skill 2 = 7

Fight button (Click)

The expected outputs outputted to the new attributes label Video 1

If the dice roll is the same it outputs as a draw

Running the program and consulting the text file and video

Clicking on the fight button lots until a draw result is outputted

Video 2

Page 29: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

Exemplar Candidate WorkA453 Sample Material Example C1 – Visual Basic

29 © OCR 2015

Criteria check

Page 30: A453 Sample Material Example C1 – Visual Basic Sample Material Example C1 – Visual Basic ... A453 Sample Material Example C1 – Visual Basic Exemplar ... met and the program does

The

smal

l pri

nt

We’d like to know your view on the resources we produce. By clicking on the ‘Like’ or ‘Dislike’ button you can help us to ensure that our resources work for you. When the email template pops up please add additional comments if you wish and then just click ‘Send’. Thank you.

If you do not currently offer this OCR qualification but would like to do so, please complete the Expression of Interest Form which can be found here: www.ocr.org.uk/expression-of-interest

OCR Resources: the small print

OCR’s resources are provided to support the teaching of OCR specifications, but in no way constitute an endorsed teaching method that is required by the Board and the decision to use them lies with the individual teacher. Whilst every effort is made to ensure the accuracy of the content, OCR cannot be held responsible for any errors or omissions within these resources. We update our resources on a regular basis, so please check the OCR website to ensure you have the most up to date version.

© OCR 2015 – This resource may be freely copied and distributed, as long as the OCR logo and this message remain intact and OCR is acknowledged as the originator of this work.

OCR acknowledges the use of the following content:

Square down and Square up: alexwhite/Shutterstock.com

Please get in touch if you want to discuss the accessibility of resources we offer to support delivery of our qualifications: [email protected]

OCR is part of Cambridge Assessment, a department of the University of Cambridge. For staff training purposes and as part of our quality assurance programme your call may be recorded or monitored. © OCR 2015 Oxford Cambridge and RSA Examinations is a Company Limited by Guarantee. Registered in England. Registered office 1 Hills Road, Cambridge CB1 2EU. Registered company number 3484466. OCR is an exempt charity.

General qualificationsTelephone 01223 553998Facsimile 01223 552627Email [email protected]

ocr.org.uk/alevelreformOCR customer contact centre

We will inform centres about any changes to the specification. We will also publish changes on our website. The latest version of our specification will always be the one on our website (www.ocr.org.uk) and this may differ from printed versions.

Copyright © OCR 2015. All rights reserved.

Copyright OCR retains the copyright on all its publications, including the specifications. However, registered centres for OCR are permitted to copy material from this specification booklet for their own internal use.


Recommended