Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

How do I write code for these commands?

Hi, I'm just wondering what would be the codes for the below.
•Calls CountScoresBelowAverage(), then displays the return
value.
•Calls CountScoresAboveOrEqualToAvg(), then displays the
return value.
•Calls CountMatchingScore(), passes it the value in the Textbox
and then displays the return value
•Calls CalcSpread(), passes it the Lowest Score & Highest
Score and then displays the return value
•Displays the number of times each value in the range 1-10
appears in the Number Listbox
Return Type None




0
Lan88
Asked:
Lan88
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Display the values in what?  A Console application or a WinForms application?

Basically you declare a variable to hold the return value and assign the output of the function to it:

    Dim NumScoresBelowAverage As Integer = CountScoresBelowAverage()

If a Console application, then you could display it like this:

    Console.WriteLine("Number of scores below average: " & NumScoresBelowAverage)

If a WinForms application, then you'd assign it to a Text() property of some control (like a Label):

    Label1.Text = "Number of scores below average: " & NumScoresBelowAverage
0
 
Lan88Author Commented:
Hi,

I gathered it would be easier to attached the pdf so you have a better idea of what I am trying to achieve.

Thanks, Lan
2011-S2-I.Prog-Ass2-v1.0.0.pdf
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
That looks like a multi-line TextBox.

You could use the AppendText() method to add each line of output:

    Dim NumScoresBelowAverage As Integer = CountScoresBelowAverage()
    TextBox1.AppendText("Number of scores below average: " & NumScoresBelowAverage & vbCrLf)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now