Ошибка компиляции "No overload for method "ball" takes 0 arguments" при расчете среднего балла - C#
Формулировка задачи:
Всем привет! Есть кусок кода из класса student
И метод, который высчитывает средний балл
При компиляции вылазит ошибка "No overload for method "ball" takes 0 arguments". В чём ошибка?
Листинг программы
- private int math = 8;
- private int history = 7;
- private int drawing = 9;
- private int philosophy = 8;
- private int business = 10;
Листинг программы
- public double ball(double a)
- {
- a = (math+history+drawing+philosophy+business)/5;
- return a;
- }
Решение задачи: «Ошибка компиляции "No overload for method "ball" takes 0 arguments" при расчете среднего балла»
textual
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Student
- {
- private int group_number = 31;
- private int student_number = 21;
- private string last_name = "Shestopalov";
- private string first_name = "Denis";
- private string dad_name = "Alexandrovich";
- private int math = 8;
- private int history = 7;
- private int drawing = 9;
- private int philosophy = 8;
- private int business = 10;
- public void Info()
- {
- Console.WriteLine("Номер группы = {0}", group_number);
- Console.WriteLine("Номер студента = {0}", student_number);
- Console.WriteLine("Фамилия = {0}", last_name);
- Console.WriteLine("Имя = {0}", first_name);
- Console.WriteLine("Отчество = {0}", dad_name);
- }
- public double ball(double a)
- {
- a = (math+history+drawing+philosophy+business)/5;
- return a;
- }
- }
- class Program
- {
- static void Main()
- {
- Student enter = new Student();
- enter.Info();
- enter.ball();
- Console.ReadKey();
- }
- }
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д