Pseudo code question

Nov 12, 2016 at 3:38am
What does <> mean in pseudocode?
Thanks.

For example while(something <> 0)
Last edited on Nov 12, 2016 at 3:39am
Nov 12, 2016 at 3:44am
It could be
while(something < 0 || something > 0)
.
Nov 12, 2016 at 3:47am
It's super vague in the pseudocode I was provided, it doesn't really make any sense to me.

it actually says while ( dollars <> 0) displayBills(dollars)
Nov 12, 2016 at 3:50am
What are the details of your assignment?
Have you started the assignment yet?
Nov 12, 2016 at 3:53am
Yeah, I started it. This is one of the first lines of code so that's why I don't really understand the <> sign. It's a simple assignment, but sometimes the professor writes the pseudocode like shit.
Nov 12, 2016 at 3:53am
I think that it is a non-standard symbol for is not equal to here; while( dollars is not equal to zero )

The standard mathematical symbol is , the equivalent C++ operator is !=
Nov 12, 2016 at 3:56am
1
2
3
4
5
6
7
8
9
10
11
// Start 
//     Declarations 
//       num dollars 
//     output "Please enter the a whole dollar amount (no cents!).  Input 0 to terminate: " 
//     input dollars 
//     while ( dollars <> 0) 
//       displayBills(dollars) 
//       output "Please enter the a whole dollar amount (no cents!).  Input 0 to terminate: " 
//       input dollars
//     endwhile 
// Stop 


Also, there's more code after the "Stop" pseudo, what would "stop" translate into c++ code?

Also, I want to add I don't want you to do the assignment, I just want to know what
<> and "stop" translates into.

Thanks.
Last edited on Nov 12, 2016 at 3:57am
Nov 12, 2016 at 3:57am
Also, there's more code after the "Stop" pseudo, what would "stop" translate into c++ code?
"Stop" literally means the end of the function main().
Nov 12, 2016 at 3:59am
Yeah, that's what I thought. What is this dude doing, there can't be code added after main()..

example.
1
2
3
4
5
6
7
// Stop 
//
 //
 //
 // displayBills(num dollars) 
//     Declarations 
//       num ones 
Nov 12, 2016 at 4:00am
1
2
3
 // displayBills(num dollars) 
//     Declarations 
//       num ones  

It means you have to implement a new function, displayBills().
Nov 12, 2016 at 4:01am
Oh I see. Thanks, Tencacle. You've been a big help. Cheers.
Nov 12, 2016 at 4:21am
If you're still there I have one last question.
Would this pseudo mean to multiply by 20%?

temp = dollars % 20
Nov 12, 2016 at 4:22am
If you're still there I have one last question.
Would this pseudo mean to multiply by 20%?

No.
Nov 12, 2016 at 4:23am
Can you please explain what it would mean then?
Nov 12, 2016 at 4:23am
temp = dollars * 0.20;
Nov 12, 2016 at 4:24am
That's what I meant, multiplying by 20% is written at * .20.
Thanks.
Nov 12, 2016 at 5:00am
> Would this pseudo mean to multiply by 20%? temp = dollars % 20

It means: set temp to the remainder after division of dollars by 20.
https://en.wikipedia.org/wiki/Modulo_operation
Topic archived. No new replies allowed.