A question about adding unknown variables.

So I received an assignment and one of the questions was as follows:

“Prompt the user for NUM representing a number of marks. The program should then allow the user to enter NUM marks and calculate and display: A) the average of passing marks. B) the average of all the marks.”

My question is: How can I add all the unknown marks entered?

Say I said there are ten classes that I have been marked in and I enter a mark for each, how would I add those.

I have no idea what I’m doing, the latest thing we’ve done is print method and counters. I’m a total noob so don’t get mad if my skills are very minimal.

I’m using vb 6.0 and I’ve figured out how many passing marks there are by using a counter (passavg):

Dim mark as integer Dim NUM as integer Dim passavg as single Dim avg as single Din total as single Dim k as integer

Passavg = 0

NUM = Val(inputbox$(“enter the amount of classes you have been marked in”)

For k = 1 to NUM If mark >= 50 then Passavg = passavg + 1 End if Next k

submitted by /u/anonomys-nobody
[link] [comments]

Leave a Reply