Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: (untagged)
I really need help with this I have reached out to other places with no help. I need specific info and an explanation. like what do I declare, and how. I have started but have no clue if I am even close thank you for your help


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.


This is what I have
VB
Dim EnterNumber As String
    dim average = 0
    dim sum = 0
    Dim number As String
    
    Sub Main()
        InputBox("insert number")
        Return
    End Sub

End Module
Posted
Updated 12-Jul-15 23:17pm
v4
Comments
Manfred Rudolf Bihy 12-Jul-15 14:58pm    
What kind of pseudo code are you supposed to use? Maybe your course material has details on that. :D
This smelleth distinctly of "laborare ad domum" ;)
Member 11831765 12-Jul-15 15:01pm    
it doesn't I can show u an example of what it is using...
Pseudocode:


start

Declarations

num idNumber

num policiesSold

num POLICY_MIN = 25

housekeeping()

detail()

finish()

stop


housekeeping()

output “Salesperson program”

input idNumber, policiesSold

return


detail()

if policiesSold > POLICY_MIN then

output idNumber, policiesSold

endif

return


finish()

output “End of program”

return
Manfred Rudolf Bihy 12-Jul-15 15:16pm    
I can't see any of the statements you used like inputbox and sub. Why don't you just adhere to what is used in the given examples?
Member 11831765 12-Jul-15 15:57pm    
I am trying but I don't understand what I am to declare and how to do it
Manfred Rudolf Bihy 12-Jul-15 16:18pm    
Sorry, but I can't help you with that either. You'd better ask the person or community from which you obtained this assignment. Sometimes details like this are given in the lecture.

1 solution

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.
Something like
Sum = 0
Average = 0
Count = 0
Do
  Print "Enter a number: "
  Read Number
  If Number ISNOT 0 Then
    Sum = Sum + Number
    Count = Count + 1
  EndIf
While Number ISNOT 0
'
' Calculate average here and print it and the sum
'


Note: This is for guidance, please do not submit it as your own work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900