gw07mcgheerachel
Badges: 18
Rep:
?
#1
Report Thread starter 3 years ago
#1
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.
0
reply
username3434964
Badges: 21
Rep:
?
#2
Report 3 years ago
#2
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
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#3
Report Thread starter 3 years ago
#3
Ok Thanks
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#4
Report Thread starter 3 years ago
#4
(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.
0
reply
username3434964
Badges: 21
Rep:
?
#5
Report 3 years ago
#5
(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
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#6
Report Thread starter 3 years ago
#6
(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?
0
reply
username3434964
Badges: 21
Rep:
?
#7
Report 3 years ago
#7
(Original post by gw07mcgheerachel)
What's triple science?
Basically 3 GCSE's, Chemistry, Biology and Physics

https://www.thestudentroom.co.uk/sho....php?t=1782763
0
reply
CompSci in2k17
Badges: 15
Rep:
?
#8
Report 3 years ago
#8
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
1
reply
Revolver72
Badges: 18
Rep:
?
#9
Report 3 years ago
#9
(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]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.
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#10
Report Thread starter 3 years ago
#10
(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]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
0
reply
Revolver72
Badges: 18
Rep:
?
#11
Report 3 years ago
#11
(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?
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#12
Report Thread starter 3 years ago
#12
(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 .
0
reply
CompSci in2k17
Badges: 15
Rep:
?
#13
Report 3 years ago
#13
http://www.ocr.org.uk/Images/202654-...code-guide.pdf
0
reply
gw07mcgheerachel
Badges: 18
Rep:
?
#14
Report Thread starter 3 years ago
#14
Thanks for adding this to the thread it seems to be pretty helpful
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
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

What support do you need with your UCAS application?

I need help researching unis (6)
10.34%
I need help researching courses (5)
8.62%
I need help with filling out the application form (3)
5.17%
I need help with my personal statement (25)
43.1%
I need help with understanding how to make my application stand out (14)
24.14%
I need help with something else (let us know in the thread!) (2)
3.45%
I'm feeling confident about my application and don't need any help at the moment (3)
5.17%

Watched Threads

View All