The Student Room Group

Computer Science Paper 2 OCR GCSE (9-1) Unofficial Mark scheme

Scroll to see replies

Original post by RocksLikeA13055
for that i got 2,3,4
and the next one was 3*5 which was 15


Same here :smile:
yea same
Original post by Loci Pi
What did everyone get for the 2nd question about the first 3 numbers output and how many times does line 3 repeat?



i think i got 2,3,4 and it repeats 15 times.
Reply 23
Original post by ThomasClay
2 programming constructs were ITERATION and SEQUENCING


no mate . your wrong its stuff like if, for etc
Original post by Loci Pi
I did 'A OR (NOT B) for the logic one

B5 for hexadecimal

10000100 for the binary one

Sequence and Iteration

* for SQL Wild Card

One place left shift for doubling

M and K for variables (if I remember correctly)

ASCII in 7 bits, extended ASCII in 8 bits so it has more combinations for characters.


M WAS NOT THE VARIABLE IT WAS THE CONSTANT
THE VARIABLE WAS P and K (i think)
Original post by samsam78910
Alright, these are the questions I remember:
The SQL ones:
Data types: string / text, integer, boolean
SQL statement: SELECT StudentName FROM Conduct WHERE Points < 0
Wildcard: * (an asterik)

Algorithm:
If studentdata [3] == "TRUE" then
Print ("sent":wink:
Else
Print ("not sent":wink:
Endif

For the algorithm with the nested for loop:
First three outputted numbers: 2,3,4 (not sure about this)
Number of times line 3 repeats: 15
Define a variable: stores a data value under an identifier which links to a memory location. The value can change at any time whilst the programme is running
The two variables: could have been m,k or p

The library code question:
The parameter was "year"
The number in .subString () was 3
The next line is assigning it to any variable name (I named it "code":wink:

The algorithm:
Title = input ("enter title":wink:
Year = input ("enter year":wink:
code = librarycode (title, year)
file = openWrite ("books.txt":wink: - can't remember the file name
file.writeLine (code)
file.close ()

Difference between a function and a procedure:
Functions always return at least one value whereas parameters don't return a value.

Advantages of subprograms:
- useful when you need to repeat code in diferent places in a program
-more structure and readability
-cuts down on amount of code
(+explanation as 4 marks)

For the infinite loop question:
The first two were infinite the second two were not.

Algorithm to count to 10:
For k = 1 to 10
print k
next k

132 in binary: 10000100
Binary to hex : B5
To double number: left shift 1 place
That's what I remember


I got pretty much exactly this, except for the library question, where I believe the last word should have been "return" instead of assigning a new variable, and I don't know if you can put 'm' as the variable for the nested loop question, as the mark scheme may be picky and claim it's a constant, because it isn't changed.
But otherwise agree with this :smile:
Original post by mojoac
no mate . your wrong its stuff like if, for etc


No I’m not, these are what you call the programming construct versions of IF, While, For etc
Original post by Rasooli17
M WAS NOT THE VARIABLE IT WAS THE CONSTANT
THE VARIABLE WAS P and K (i think)


Ahhh ****!!!!!!
Reply 28
Original post by ThomasClay
Ahhh ****!!!!!!


My thoughts exactly
Original post by Mino458
My thoughts exactly


I wrote what a variable was and then for some reason changed my answer to m as I thought a variable didn’t change
Original post by Loci Pi
What did everyone get for the 2nd question about the first 3 numbers output and how many times does line 3 repeat?


2,3,4 as the nested 'for' loop has to run from k = 1 to 5 before p can become 2.

Originally I wrote 2,4 and 6, but realised the mistake and changed it.

Line 3 repeated 15 times, since the k ran from 1 to 5 for each p, which was from 1 to 3.
Reply 31
Guys what was the symbols notation for logic gates i think i may have seen something different in my exam and got it wrong :frown:
Original post by tryhard11
2,3,4 as the nested 'for' loop has to run from k = 1 to 5 before p can become 2.

Originally I wrote 2,4 and 6, but realised the mistake and changed it.

Line 3 repeated 15 times, since the k ran from 1 to 5 for each p, which was from 1 to 3.


Ahhh sh*t
Original post by mojoac
no mate . your wrong its stuff like if, for etc


The use of 'For' loops is called iteration, while the specific order that the code is written in so the program runs correctly is sequence. There were only 3 constructs to choose from: Sequence, Iteration and Selection.
Original post by Alkey
Guys what was the symbols notation for logic gates i think i may have seen something different in my exam and got it wrong :frown:


The notation was for the diagram A OR (NOT B)
Original post by dsmacaroy
I got pretty much exactly this, except for the library question, where I believe the last word should have been "return" instead of assigning a new variable, and I don't know if you can put 'm' as the variable for the nested loop question, as the mark scheme may be picky and claim it's a constant, because it isn't changed.
But otherwise agree with this :smile:


Aaahh sh*t that was such a stupid mistake.
Original post by RocksLikeA13055
for that i got 2,3,4
and the next one was 3*5 which was 15


me too. Pretty sure it was nested for loops, meaning it was indeed 2,3,4.
Original post by Rasooli17
M WAS NOT THE VARIABLE IT WAS THE CONSTANT
THE VARIABLE WAS P and K (i think)


I don't even remember what i put tbh, but it didn't specify constant anywhere and it wasnt in capitals so i think this means we can assume it's technically a variable - just because the program doesn't change it, doesn't mean it can't change :wink:
Original post by dsmacaroy
I got pretty much exactly this, except for the library question, where I believe the last word should have been "return" instead of assigning a new variable, and I don't know if you can put 'm' as the variable for the nested loop question, as the mark scheme may be picky and claim it's a constant, because it isn't changed.
But otherwise agree with this :smile:


I originally put index 4 for the student data table because there were two seperate words as one element on the list and my dumb self skimming through it just assumed they were 2 elements. Glad I double checked and changed to 3 though :smile:
Reply 39
Original post by samsam78910
Alright, these are the questions I remember:
The SQL ones:
Data types: string / text, integer, boolean
SQL statement: SELECT StudentName FROM Conduct WHERE Points < 0
Wildcard: * (an asterik)

Algorithm:
If studentdata [3] == "TRUE" then
Print ("sent")
Else
Print ("not sent")
Endif

For the algorithm with the nested for loop:
First three outputted numbers: 2,3,4 (not sure about this)
Number of times line 3 repeats: 15
Define a variable: stores a data value under an identifier which links to a memory location. The value can change at any time whilst the programme is running
The two variables: could have been m,k or p

The library code question:
The parameter was "year"
The number in .subString () was 3
The next line is assigning it to any variable name (I named it "code")

The algorithm:
Title = input ("enter title")
Year = input ("enter year")
code = librarycode (title, year)
file = openWrite ("books.txt") - can't remember the file name
file.writeLine (code)
file.close ()

Difference between a function and a procedure:
Functions always return at least one value whereas parameters don't return a value.

Advantages of subprograms:
- useful when you need to repeat code in diferent places in a program
-more structure and readability
-cuts down on amount of code
(+explanation as 4 marks)

For the infinite loop question:
The first two were infinite the second two were not.

Algorithm to count to 10:
For k = 1 to 10
print k
next k

132 in binary: 10000100
Binary to hex : B5
To double number: left shift 1 place
That's what I remember


I think the filling in pseudocode one for the librarycode() function was RETURN for the last gap because there hadn’t been a value returned yet

Quick Reply

Latest

Trending

Trending