6 Replies - 2425 Views - Last Post: 07 July 2015 - 01:54 PM Rate Topic: -----

#1 tiffanygonzales82   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-July 15

VB loop pseudocode help

Posted 07 July 2015 - 01:33 PM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: VB loop pseudocode help

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 16479
  • View blog
  • Posts: 65,313
  • Joined: 12-June 08

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.
Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

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.
Was This Post Helpful? 0
  • +
  • -

#4 tiffanygonzales82   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-July 15

Re: VB loop pseudocode help

Posted 07 July 2015 - 01:47 PM

View Postmacosxnerd101, 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.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 16479
  • View blog
  • Posts: 65,313
  • Joined: 12-June 08

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:
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.
Was This Post Helpful? 0
  • +
  • -

#6 tiffanygonzales82   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-July 15

Re: VB loop pseudocode help

Posted 07 July 2015 - 01:52 PM

Average= total of numbers / number total.
sum = total of numbers
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1