Ok so my prof. is about zero help, my emails and questions go unanswered and I am so lost in my class that it is not even funny. I have posted my assignment here, I don't want anyone to do it for me but what I need is direction. Things like what to declare, how to indent and space correctly. This is just a pseudocode for now but will have to write the program too.. Please anything you can teach me would be helpful thank you.
Students will first create and turn in the pseudocode for the program. Once the pseudocode assignment has been completed and turned in, students will code the programs using their chosen language (Java or Visual Basic). I chose VB.
As stated above, you will first use pseudocode to create the logic for a program that accepts user input for several numbers. The user will be allowed to continually input numbers until a 0 (zero) is entered. After the user enters a zero, the program will display the sum and the average of the numbers.
VB loop pseudocode help
Page 1 of 16 Replies - 2425 Views - Last Post: 07 July 2015 - 01:54 PM
Replies To: VB loop pseudocode help
#2
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:40 PM
Okay.. there is no real "pseudo code" language, and c++ certainly isn't it. I'll move this to vb.net.
The assignment is straight forward.. write down the variable names you are declaring.
It seems a loop is involved.. so write that out.
The body of the loop seems to do what? Keep asking for input, adding the input to a variable called 'sum' and averaging into a variable called 'average'.. when over they are printed out.
The assignment is straight forward.. write down the variable names you are declaring.
It seems a loop is involved.. so write that out.
The body of the loop seems to do what? Keep asking for input, adding the input to a variable called 'sum' and averaging into a variable called 'average'.. when over they are printed out.
#3
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:40 PM
Quote
The user will be allowed to continually input numbers until a 0 (zero) is entered. After the user enters a zero, the program will display the sum and the average of the numbers.
So how do you calculate the average? How do you calculate the sum? What variables do you think you need to store? Talk to us about your thoughts and logic some.
#4
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:47 PM
macosxnerd101, on 07 July 2015 - 01:40 PM, said:
Quote
The user will be allowed to continually input numbers until a 0 (zero) is entered. After the user enters a zero, the program will display the sum and the average of the numbers.
So how do you calculate the average? How do you calculate the sum? What variables do you think you need to store? Talk to us about your thoughts and logic some.
Ok so I think it would be best to do a "do while" loop. I am lost on what to declare if anything really. And as far as there needs to be a line in the code to show the user the sum and the average. I am sorry if I seem lost, I really am, I am looking in my book as I writing to you as well.
#5
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:49 PM
Again, unless your instructor provided examples of what pseudo code s/he are looking for there is no structure.
If you want to show a variable called 'foo' then simply write:
If you want to show a variable being assigned a value you can do:
or
If you want to show printing of a variable then simply write:
Again - not that complex.
If you want to show a variable called 'foo' then simply write:
DECLARE foo
If you want to show a variable being assigned a value you can do:
foo GETS 1
or
foo = 1
If you want to show printing of a variable then simply write:
PRINT foo
Again - not that complex.
#6
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:52 PM
Average= total of numbers / number total.
sum = total of numbers
sum = total of numbers
#7
Re: VB loop pseudocode help
Posted 07 July 2015 - 01:54 PM
I would think about what you want to do when you read in a single number. Just think about one number for now, and not the entire list of them.
Next, think about what you want to do after you've read in 0.
Next, think about what you want to do after you've read in 0.
Page 1 of 1

New Topic/Question
Reply


MultiQuote






|