Ocr computer science gcse Watch

IsMo987
Badges: 11
Rep:
?
#1
Report Thread starter 1 week ago
#1
Help needed with programming pleaseeee
Posted on the TSR App. Download from Apple or Google Play
0
reply
nat5dawg
Badges: 8
Rep:
?
#2
Report 1 week ago
#2
Can you be a bit more specific?
0
reply
IsMo987
Badges: 11
Rep:
?
#3
Report Thread starter 1 week ago
#3
(Original post by nat5dawg)
Can you be a bit more specific?
Like algorithms pseudo code and stuff like that and loops and basically how to concept a program
Posted on the TSR App. Download from Apple or Google Play
0
reply
nat5dawg
Badges: 8
Rep:
?
#4
Report 1 week ago
#4
(Original post by IsMo987)
Like algorithms pseudo code and stuff like that and loops and basically how to concept a program
That's still a bit vague :/

Could you find a question (maybe from a past paper or something) which you are unsure how to do? It will be much easier for me to help you if I can see exactly what it is you're stuck at.
0
reply
IsMo987
Badges: 11
Rep:
?
#5
Report Thread starter 1 week ago
#5
(Original post by nat5dawg)
That's still a bit vague :/

Could you find a question (maybe from a past paper or something) which you are unsure how to do? It will be much easier for me to help you if I can see exactly what it is you're stuck at.
Should I send you the question via email
Posted on the TSR App. Download from Apple or Google Play
0
reply
Rolls_Reus_0wner
Badges: 21
Rep:
?
#6
Report 1 week ago
#6
bump
0
reply
nat5dawg
Badges: 8
Rep:
?
#7
Report 1 week ago
#7
(Original post by IsMo987)
Should I send you the question via email
Preferably if you could attach it as a screenshot here, or send a link to the past paper itself. Just this way, other people can see this if they also perhaps need help.
0
reply
IsMo987
Badges: 11
Rep:
?
#8
Report Thread starter 5 days ago
#8
(Original post by IsMo987)
Like algorithms pseudo code and stuff like that and loops and basically how to concept a program
Name:  22ED349C-29E5-43E6-AE01-5D80FEFBFDBE.jpg.jpeg
Views: 8
Size:  13.1 KB hey this is an example
Posted on the TSR App. Download from Apple or Google Play
0
reply
IsMo987
Badges: 11
Rep:
?
#9
Report Thread starter 5 days ago
#9
Hey here’s the link as the photo isn’t clear sorry the question is 7
https://www.ocr.org.uk/Images/469791...rogramming.pdf
Posted on the TSR App. Download from Apple or Google Play
0
reply
nat5dawg
Badges: 8
Rep:
?
#10
Report 4 days ago
#10
Hi,

Here is my solution to that in pseudocode. (This is the style we use in Scotland for Nat5s Highers etc., may be different for GCSE but the basics should be the same)

DECLARE storedNumber INITIALLY 6 (they didnt say a random number, just a number)
DECLARE counter INITIALLY 0

REPEAT
counter += 1
RECEIVE userGuess (INTEGER) FROM KEYBOARD
IF userGuess < storedNumber THEN
SEND "higher" TO DISPLAY
ELSEIF userGuess > storedNumber THEN
SEND "lower" TO DISPLAY
END IF
UNTIL userGuess = storedNumber OR counter = 10

IF userGuess = storedNumber THEN
SEND "congratulations" TO DISPLAY
END IF


Evaluating this, I see a fixed loop (ie FOR counter FROM 0 TO 9 ..... END FOR) could maybe have been used, but the conditional loop (the one in the example) works fine.

Any questions on how I came to that solution just ask away.

(Also if this is wrong, please quote me and I'll change it accordingly)
Last edited by nat5dawg; 4 days ago
0
reply
IsMo987
Badges: 11
Rep:
?
#11
Report Thread starter 4 days ago
#11
(Original post by nat5dawg)
Hi,

Here is my solution to that in pseudocode. (This is the style we use in Scotland for Nat5s Highers etc., may be different for GCSE but the basics should be the same)

DECLARE storedNumber INITIALLY 6 (they didnt say a random number, just a number)
DECLARE counter INITIALLY 0

REPEAT
counter += 1
RECEIVE userGuess (INTEGER) FROM KEYBOARD
IF userGuess < storedNumber THEN
SEND "higher" TO DISPLAY
ELSEIF userGuess > storedNumber THEN
SEND "lower" TO DISPLAY
END IF
UNTIL userGuess = storedNumber OR counter = 10

SEND "congratulations" TO DISPLAY


Evaluating this, I see a fixed loop (ie FOR counter FROM 0 TO 9 ..... END FOR) could maybe have been used, but the conditional loop (the one in the example) works fine.

Any questions on how I came to that solution just ask away.

(Also if this is wrong, please quote me and I'll change it accordingly)
Thank you sooo much its really helpful How would I write this for fixed loop
Posted on the TSR App. Download from Apple or Google Play
0
reply
nat5dawg
Badges: 8
Rep:
?
#12
Report 4 days ago
#12
(Original post by IsMo987)
Thank you sooo much its really helpful How would I write this for fixed loop
No problem!

By the way, I noticed you seen my reply before I could edit it - please note I made a small change here:
.......
IF userGuess = storedNumber THEN
SEND "congratulations" TO DISPLAY
END IF
......


Basically the way I had it initially would always display the 'congrats' message, even if their guess wasn't correct. The pseudocode above is how it should look.

Now, as for how to do this with a fixed loop - I, again, did not think about it deeply enough lol. I actually believe there is no simple/efficient way to do it with a fixed loop, so the conditional actually looks like the only viable option in this case.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Cranfield University
    Cranfield Forensic MSc Programme Open Day Postgraduate
    Thu, 25 Apr '19
  • University of the Arts London
    Open day: MA Footwear and MA Fashion Artefact Postgraduate
    Thu, 25 Apr '19
  • Cardiff Metropolitan University
    Undergraduate Open Day - Llandaff Campus Undergraduate
    Sat, 27 Apr '19

Have you registered to vote?

Yes! (369)
37.2%
No - but I will (75)
7.56%
No - I don't want to (70)
7.06%
No - I can't vote (<18, not in UK, etc) (478)
48.19%

Watched Threads

View All