Official AQA New Spec AS Level Computer Science Thread - 6th of June Watch

username2250433
Badges: 13
Rep:
?
#1
Report Thread starter 3 years ago
#1
This is the official thread for this subject. Please provide revision resources and answers to any questions anyone may have
0
reply
username2250433
Badges: 13
Rep:
?
#2
Report Thread starter 3 years ago
#2
bump
0
reply
vanguardsean
Badges: 2
Rep:
?
#3
Report 3 years ago
#3
If anyone hasn't seen this already, this website has possible tasks that could come up in the exam:
https://en.wikibooks.org/wiki/A-leve...er1_this_year)
0
reply
Tryfan99
Badges: 0
Rep:
?
#4
Report 3 years ago
#4
So the COMP1 exam is just programming, pseudocode and Finite State Machines? no content from modules 3-6?
0
reply
username2250433
Badges: 13
Rep:
?
#5
Report Thread starter 3 years ago
#5
(Original post by Tryfan99)
So the COMP1 exam is just programming, pseudocode and Finite State Machines? no content from modules 3-6?
http://www.aqa.org.uk/subjects/ict-a...on-at-a-glance

have a look at that, it tells you what topics come up on both papers
0
reply
GarlicBread01
Badges: 10
Rep:
?
#6
Report 3 years ago
#6
Is there anything to take to this exam? (apart from the usual pen, pencil etc.)
0
reply
vanguardsean
Badges: 2
Rep:
?
#7
Report 3 years ago
#7
(Original post by GarlicBread01)
Is there anything to take to this exam? (apart from the usual pen, pencil etc.)
No, but remember a calculator is not allowed for COMP 1
0
reply
TheTechnoGuy
Badges: 7
Rep:
?
#8
Report 3 years ago
#8
(Original post by vanguardsean)
No, but remember a calculator is not allowed for COMP 1
calc.exe lol
0
reply
vanguardsean
Badges: 2
Rep:
?
#9
Report 3 years ago
#9
(Original post by TheTechnoGuy)
calc.exe lol
This is from the Teacher's Notes for the Computer Science New Specification Booklet:
"10.10 Candidates must not use a calculator of any sort, including that on the computer and any spreadsheet software."
0
reply
swingrx
Badges: 4
Rep:
?
#10
Report 3 years ago
#10
Has anyone got any predictions for what questions may come up for Section A and B?
From the EAD looks like there'll be a 6 marker on Hand Trace Tables...
I'm not too good at these - Does anyone know of any resources which I could practice these?

Thanks
0
reply
kazzy121
Badges: 7
Rep:
?
#11
Report 3 years ago
#11
please i got the exam tomorrow this is my code:

''
-
'Skeleton Program for the AQA AS Paper 1 Summer 2016 examination
'this code should be used in conjunction with the Preliminary Material
'written by the AQA Programmer Team
'developed in the Visual Studio 2008 programming environment

'Version Number 1.0

Imports System.IO

Module Module1
Const TrainingGame As String = "Training.txt"
Dim score As Integer = 0
Dim Missiles As Integer = 50

Structure TShip
Dim Name As String
Dim Size As Integer
End Structure

Sub GetRowColumn(ByRef Row As Integer, ByRef Column As Integer)


Console.WriteLine()
Console.WriteLine("Please enter 11 to return to menu and 12 to quit!")
Console.WriteLine("You currently have a score of " & score & " points! ")
Console.WriteLine("You have " & Missiles & " missiles left!")

If Missiles = 0 Then
Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine("Game Over!!! No More Missiles Left! ")
Console.ResetColor()
End If


Do
Console.Write("Please enter column: ")
Column = Console.ReadLine()


If Column = 11 Then

Main()
ElseIf Column = 12 Then
End
End If
If Column > -1 And Column < 13 Then
Exit Do
Else : Console.WriteLine("Please enter a boundary between 0 - 10")
End If
Loop

Do
Console.Write("Please enter row: ")
Row = Console.ReadLine()
If Row = 11 Then
Main()
ElseIf Row = 12 Then
End
End If
If Row > -1 And Row < 13 Then
Exit Do
Else : Console.WriteLine("Please enter a boundary between 0 - 10")
End If
Loop
Console.WriteLine()
End Sub

Sub MakePlayerMove(ByRef Board(,) As Char, ByRef Ships() As TShip)
Dim Row As Integer
Dim Column As Integer
GetRowColumn(Row, Column)
If Board(Row, Column) = "m" Or Board(Row, Column) = "h" Then
Console.WriteLine("Sorry, you have already shot at the square (" & Column & "," & Row & "). Please try again.")
ElseIf Board(Row, Column) = "-" Then
Console.WriteLine("Sorry, (" & Column & "," & Row & ") is a miss.")
Board(Row, Column) = "m"
If Board(Row, Column) = "m" Then
Missiles = (Missiles - 1)
End If
Else
Console.WriteLine("Hit at (" & Column & "," & Row & ").")

If Board(Row, Column) = "A" Then
Board(Row, Column) = "h"
Missiles -= 1
score = (score + 5)
Console.WriteLine("You have hit part of the Aircraft carrier")

ElseIf Board(Row, Column) = "B" Then
Board(Row, Column) = "h"
Missiles -= 1
score = (score + 4)
Console.WriteLine("You have hit part of the Battleship")

ElseIf Board(Row, Column) = "S" Then
Board(Row, Column) = "h"
Missiles -= 1
score += 3
Console.WriteLine("You have hit part of the Submarine")

ElseIf Board(Row, Column) = "D" Then
Board(Row, Column) = "h"
Missiles -= 1
score += 2
Console.WriteLine("You have hit part of the Destroyer")

ElseIf Board(Row, Column) = "P" Then
Board(Row, Column) = "h"
Missiles -= 1
score += 1
Console.WriteLine("You have hit part of the Patrol Boat")

ElseIf Board(Row, Column) = "C" Then
Board(Row, Column) = "h"
Missiles -= 1
score += 1
Console.WriteLine("You have hit part of the Cruiser")
End If
End If
End Sub

Sub SetUpBoard(ByRef Board(,) As Char)
Dim Row As Integer
Dim Column As Integer
For Row = 0 To 10
For Column = 0 To 10
Board(Row, Column) = "-"
Next
Next
End Sub

Sub LoadGame(ByVal Filename As String, ByRef Board(,) As Char)
Dim Row As Integer
Dim Column As Integer
Dim Line As String
Using FileReader As StreamReader = New StreamReader(Filename)
For Row = 0 To 10
Line = FileReader.ReadLine()
For Column = 0 To 10
Board(Row, Column) = Line(Column)

Next
Next
End Using
End Sub
Sub Savegame(ByRef Board(,) As Char)
Dim Row, Column As Integer
Dim Line As String

Using Filewriter As StreamWriter = New StreamWriter("SavedGame.txt")
For Row = 0 To 10
For Column = 0 To 10
Line = Board(Row, Column)
Filewriter.WriteLine(Line)

Next
Next

End Using
End Sub

Sub PlaceRandomShips(ByRef Board(,) As Char, ByVal Ships() As TShip)
Dim Valid As Boolean
Dim Row As Integer
Dim Column As Integer
Dim Orientation As Char
Dim HorV As Integer
For Each Ship In Ships
Valid = False
While Not Valid
Row = Int(Rnd() * 11)
Column = Int(Rnd() * 11)
HorV = Int(Rnd() * 2)
If HorV = 0 Then
Orientation = "v"
Else
Orientation = "h"
End If
Valid = ValidateBoatPosition(Board, Ship, Row, Column, Orientation)
End While
Console.WriteLine("Computer placing the " & Ship.Name)
PlaceShip(Board, Ship, Row, Column, Orientation)
Next
End Sub

Sub PlaceShip(ByRef Board(,) As Char, ByVal Ship As TShip, ByVal Row As Integer, ByVal Column As Integer, ByVal Orientation As Char)
Dim Scan As Integer
If Orientation = "v" Then
For Scan = 0 To Ship.Size - 1
Board(Row + Scan, Column) = Ship.Name(0)
Next
ElseIf Orientation = "h" Then
For Scan = 0 To Ship.Size - 1
Board(Row, Column + Scan) = Ship.Name(0)
Next
End If
End Sub

Function ValidateBoatPosition(ByVal Board(,) As Char, ByVal Ship As TShip, ByVal Row As Integer, ByVal Column As Integer, ByVal Orientation As Char)
Dim Scan As Integer
If Orientation = "v" And Row + Ship.Size > 10 Then
Return False
ElseIf Orientation = "h" And Column + Ship.Size > 10 Then
Return False
Else
If Orientation = "v" Then
For Scan = 0 To Ship.Size - 1
If Board(Row + Scan, Column) <> "-" Then
Return False
End If
Next
ElseIf (Orientation = "h") Then
For Scan = 0 To Ship.Size - 1
If Board(Row, Column + Scan) <> "-" Then
Return False
End If
Next
End If
End If
Return True
End Function

Function CheckWin(ByVal Board(,) As Char)
Dim Row As Integer
Dim Column As Integer
For Row = 0 To 10
For Column = 0 To 10
If Board(Row, Column) = "A" Or Board(Row, Column) = "B" Or Board(Row, Column) = "S" Or Board(Row, Column) = "D" Or Board(Row, Column) = "P" Or Board(Row, Column) = "C" Then
Return False
End If
Next
Next
Return True
End Function

Sub PrintBoard(ByVal Board(,) As Char)
Dim Row As Integer
Dim Column As Integer
Console.WriteLine()
Console.WriteLine("The board looks like this: ")
Console.WriteLine()
Console.Write(" ")
For Column = 0 To 10
Console.Write(" " & Column & " ")
Next
Console.WriteLine()
For Row = 0 To 10
Console.Write(Row & " ")
For Column = 0 To 10
If Board(Row, Column) = "-" Then
Console.Write(" ")
ElseIf Board(Row, Column) = "A" Or Board(Row, Column) = "B" Or Board(Row, Column) = "S" Or Board(Row, Column) = "D" Or Board(Row, Column) = "P" Or Board(Row, Column) = "C" Then
Console.Write(" ")
Else
Console.Write(Board(Row, Column))
End If
If Column <> 10 Then
Console.Write(" | ")
End If
Next
Console.WriteLine()
Next
End Sub

Sub DisplayMenu()
Console.WriteLine("MAIN MENU")
Console.WriteLine()
Console.WriteLine("1. Start new game")
Console.WriteLine("2. Load training game")
Console.WriteLine("9. Quit")
Console.WriteLine()
End Sub

Function GetMainMenuChoice()
Dim Choice As Integer
Console.Write("Please enter your choice: ")
Choice = Console.ReadLine()
Console.WriteLine()
Return Choice
End Function

Sub PlayGame(ByVal Board(,) As Char, ByVal Ships() As TShip)
Dim GameWon As Boolean = False
Do
PrintBoard(Board)
MakePlayerMove(Board, Ships)
GameWon = CheckWin(Board)
If GameWon Then
Console.WriteLine("All ships sunk!")
Console.WriteLine()
End If
Loop Until GameWon
End Sub

Sub SetUpShips(ByRef Ships() As TShip)
Ships(0).Name = "Aircraft Carrier [Worth 5 points]"
Ships(0).Size = 5
Ships(1).Name = "Battleship [Worth 4 points]"
Ships(1).Size = 4
Ships(2).Name = "Submarine [Worth 3 points]"
Ships(2).Size = 3
Ships(3).Name = "Destroyer [Worth 2 points]"
Ships(3).Size = 3
Ships(4).Name = "Patrol Boat [Worth 1 point]"
Ships(4).Size = 2
Ships(5).Name = "Cruiser [Worth 1 point]"
Ships(5).Size = 1
End Sub

Sub Main()
Dim Board(10, 10) As Char
Dim Ships(5) As TShip
Dim MenuOption As Integer
Do
SetUpBoard(Board)
SetUpShips(Ships)
DisplayMenu()
MenuOption = GetMainMenuChoice()
If MenuOption = 1 Then
PlaceRandomShips(Board, Ships)
PlayGame(Board, Ships)
ElseIf MenuOption = 2 Then
LoadGame(TrainingGame, Board)
PlayGame(Board, Ships)
End If
Loop Until MenuOption = 9
End Sub
End Module
-
"

how can I call the savegame when user enters 11 or 12 when choosing what co ordinates to enter?
0
reply
vanguardsean
Badges: 2
Rep:
?
#12
Report 3 years ago
#12
(Original post by kazzy121)
please i got the exam tomorrow this is my code:
how can I call the savegame when user enters 11 or 12 when choosing what co ordinates to enter?
Do you want to call SaveGame as the user enters 11/12 or after the user has already entered the co-ordinates?
0
reply
kazzy121
Badges: 7
Rep:
?
#13
Report 3 years ago
#13
(Original post by vanguardsean)
Do you want to call SaveGame as the user enters 11/12 or after the user has already entered the co-ordinates?
either way i dont mind help pleasee
0
reply
kazzy121
Badges: 7
Rep:
?
#14
Report 3 years ago
#14
the exams tomorrow morning please, how do i calle the save gameand also let user choose between training game and savedgame
0
reply
83457
Badges: 4
Rep:
?
#15
Report 3 years ago
#15
How many misses and hits did you people get for the last question?
0
reply
vanguardsean
Badges: 2
Rep:
?
#16
Report 3 years ago
#16
(Original post by 83457)
How many misses and hits did you people get for the last question?
2 misses 1 hit for the first test in the last question
0
reply
83457
Badges: 4
Rep:
?
#17
Report 3 years ago
#17
(Original post by vanguardsean)
2 misses 1 hit for the first test in the last question
there was more than one test for the last question?

And did you get 12,25,53,0 for NewItems for the tracetable question? What did you state its function was?
0
reply
swingrx
Badges: 4
Rep:
?
#18
Report 3 years ago
#18
Can anyone remember what Question 3 was?
It was worth 2 marks, you it was a table of three rows...
0
reply
vanguardsean
Badges: 2
Rep:
?
#19
Report 3 years ago
#19
(Original post by 83457)
there was more than one test for the last question?

And did you get 12,25,53,0 for NewItems for the tracetable question? What did you state its function was?
Yes, you had to do two tests for the last question - the first was where the torpedo was fired and moved up three spaces. The second was showing that after the torpedo was fired, a normal shot was fired correctly (as the user only had one torpedo available)

Yes, I think I got something like that for the trace table, cant remember the whole table unfortunately

I wasn't sure about the function of the algorithm - I think it was something to do with ordering the data in a certain way
0
reply
vanguardsean
Badges: 2
Rep:
?
#20
Report 3 years ago
#20
(Original post by swingrx)
Can anyone remember what Question 3 was?
It was worth 2 marks, you it was a table of three rows...
I think that question has about finite state machines where you had to state if the strings would be accepted - you had to answer YES/NO for the three strings given in the question
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top

University open days

  • Regent's University London
    Postgraduate Open Evening Postgraduate
    Thu, 19 Sep '19
  • Durham University
    Pre-Application Open Days Undergraduate
    Fri, 20 Sep '19
  • Loughborough University
    Undergraduate Open Day Undergraduate
    Fri, 20 Sep '19

What's your favourite genre?

Rock (188)
23.95%
Pop (192)
24.46%
Jazz (30)
3.82%
Classical (46)
5.86%
Hip-Hop (148)
18.85%
Electronic (53)
6.75%
Indie (128)
16.31%

Watched Threads

View All
Latest
My Feed