The Student Room Group

Higher Computing Pseudo Code

I have been told to write the pseudo code for a problem in which a random number between 0 and 4 is created to show the score. I am unsure how to make this happen.
Even

create:

Number = Random (0 - 4)

?



Sorry don't do comp science, but am interested in it. Might do it if I can... But I also want to do triple science :P
Ok Thanks
Original post by cc85734
Even

create:

Number = Random (0 - 4)

?



Sorry don't do comp science, but am interested in it. Might do it if I can... But I also want to do triple science :P


It's a great subject I'm doing it at CfE Higher level.
Original post by gw07mcgheerachel
It's a great subject I'm doing it at CfE Higher level.


I really hope I can do triple science and comp science but its not looking great :P
Original post by cc85734
I really hope I can do triple science and comp science but its not looking great :P


What's triple science?
Original post by gw07mcgheerachel
What's triple science?


Basically 3 GCSE's, Chemistry, Biology and Physics

https://www.thestudentroom.co.uk/showthread.php?t=1782763
(edited 6 years ago)
No it wouldn't, pseudo-code still adheres to strict rules from the exam board. It has to follow a certain structure, syntax and format
Original post by gw07mcgheerachel
I have been told to write the pseudo code for a problem in which a random number between 0 and 4 is created to show the score. I am unsure how to make this happen.


I'd tend to disagree with a lot of people from above. Certainly, when I did Higher Computing and my degrees, pseudo-code does actually have to follow some vague rules of syntax.

As a general rule of thumb, use the BBC Bitesize page on designing pseudo-code. It's pretty useful, and while it's been updated in the last 7 years or so, it was the resource I used a lot during Higher Computing. While people have a some personal preference for writing pseudo-code, Higher Computing uses a fairly plain format.

Your program literally appears, certainly from your OP, to only generate a random number and then (presumably) display that number. There are no loops, conditionals or complicated logical expressions to follow here. So your pseudo-code should merely be:


Score = Random(0,4)
Print Score

If you really wanted to expand it out, you could make your declaration and type clear first, then do the assignment. So like:

New Integer Score
Score = Random(0,4)
Print Score


Can't remember from Higher Computing what would be preferred, but I would say the latter is clearer.
No need for code syntax in pseudo-code, you're literally just saying I'm declaring a variable called Score which will hold an integer (whole number) value, and it's going to generate a random number (with the range of 0-4). Then I want to print the score.
Original post by Revolver72
I'd tend to disagree with a lot of people from above. Certainly, when I did Higher Computing and my degrees, pseudo-code does actually have to follow some vague rules of syntax.

As a general rule of thumb, use the BBC Bitesize page on designing pseudo-code. It's pretty useful, and while it's been updated in the last 7 years or so, it was the resource I used a lot during Higher Computing. While people have a some personal preference for writing pseudo-code, Higher Computing uses a fairly plain format.

Your program literally appears, certainly from your OP, to only generate a random number and then (presumably) display that number. There are no loops, conditionals or complicated logical expressions to follow here. So your pseudo-code should merely be:


Score = Random(0,4)
Print Score

If you really wanted to expand it out, you could make your declaration and type clear first, then do the assignment. So like:

New Integer Score
Score = Random(0,4)
Print Score


Can't remember from Higher Computing what would be preferred, but I would say the latter is clearer.
No need for code syntax in pseudo-code, you're literally just saying I'm declaring a variable called Score which will hold an integer (whole number) value, and it's going to generate a random number (with the range of 0-4). Then I want to print the score.


Okay thanks, we were to do it for homework and then we spoke about it in class and the teacher just made it -

SET outball TO random number between 0 and 4
Original post by gw07mcgheerachel
Okay thanks, we were to do it for homework and then we spoke about it in class and the teacher just made it -

SET outball TO random number between 0 and 4


Ah cool. Couldn't have called the variable name without having seen the sheet.
Looks like Higher has changed since I did it. Good luck with the course. How are you finding it?
Original post by Revolver72
Ah cool. Couldn't have called the variable name without having seen the sheet.
Looks like Higher has changed since I did it. Good luck with the course. How are you finding it?


Not too bad thanks , I certainly struggle more with the coding stuff than the databases but that's always been my case. I'm struggling a bit cos I sat national 5 in 4th year and I'm sitting the higher in 6th so I had a gap year from computing, so just trying to pick it up again :smile:.


Thanks for adding this to the thread it seems to be pretty helpful

Quick Reply

Latest

Trending

Trending