#pseudocode/ beginner hw

45 messages · Page 1 of 1 (latest)

wispy ember
#

How do I write this

sharp grove
#

What do you mean by "How do I write this"

wispy ember
#

The pseudocode

#

I’m new to all of this but n idk how to start

sharp grove
#

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

wispy ember
#

So

#

Start

#

Input

#

Input * 10

sharp grove
#

Okay that's a start

wispy ember
#

Do I need more words to be specific?

sharp grove
#

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

wispy ember
#

Okay so would you be able to understand this?

#

And would this also answer what the professor is asking

sharp grove
#

Do you have examples of how your professor has written pseudocode?

#

Maybe have a look at those

wispy ember
#

This is one but why would myAnswer also be on the same line as myNumber*2

#

Could it not just just be myNumber*2

sharp grove
#

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?

wispy ember
#

Gave me 2

#

I see now

misty ravineBOT
# sharp grove !exec

@sharp grove

✅ Exec - Success (Super User 🦸)
1

sharp grove
#

Yes, the reason why you need to assign it to a variable is because just multiplying it doesn't change the value

wispy ember
#

Okay thanks man

#

So this should do correct?

sharp grove
#

I don't know

#

It doesn't seem like you followed the steps given

wispy ember
#

Such a drag

sharp grove
#

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

wispy ember