Bing In

Bing In

  • NA
  • 30
  • 8.9k

sum and average calculation using method mark_cnt()

May 1 2016 4:37 AM
 
output add 3 subject scores and average scores of 3 subjects 
 
parameters in mark_cnt() method must include keyword out
 
edit my code below

 
 
public static void Main()
{
Console.WriteLine("enter biology score");
int korean = int.Parse(Console.ReadLine());
Console.WriteLine("enter english score");
int english = int.Parse(Console.ReadLine());
Console.WriteLine("enter math score");
int math = int.Parse(Console.ReadLine());
mark_cnt(out biology, out english, out math);
}
public static void mark_cnt(out int k, out int e, out int m)
{
int sum;
int avg;
sum = k + e + m;
avg = k + e + m / 3;
}
 

Answers (1)