#pseudocode/ beginner hw
45 messages · Page 1 of 1 (latest)
What do you mean by "How do I write this"
Pseudocode is not a rigorously standardised thing. It's mostly just a series of steps in english that explains how an algorithm work
So the first thing you want to think about are what steps you'll need to take in order to achieve your goal
Okay that's a start
Do I need more words to be specific?
Probably
The point of pseudocode is for it to be specific enough so that anyone will be able to correctly implement an algorithm, but general enough so that it can be achieved using any language
Okay so would you be able to understand this?
And would this also answer what the professor is asking
Do you have examples of how your professor has written pseudocode?
Maybe have a look at those
This is one but why would myAnswer also be on the same line as myNumber*2
Could it not just just be myNumber*2
No
Because the value will not be saved
Have a look at this in python
my_number = 1
my_number * 2
print(my_number)
What do you expect this code to do?
!exec
@sharp grove
1
Yes, the reason why you need to assign it to a variable is because just multiplying it doesn't change the value
Such a drag
I think all you need is one line before your input line
The one that creates a new variable for number
Oh yeah, also your variable should be called number I think
Just follow the instructions given