Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Student
- {
- public string name = "";
- public int grade = 0;
- public int number = 0;
- public void setGrades() {
- Console.Write("Въведете оценка по БЕЛ: ");
- BEL = double.Parse(Console.ReadLine());
- Console.Write("Въведете оценка по ЧЕП: ");
- foreign = double.Parse(Console.ReadLine());
- Console.Write("Въведете оценка по Математика: ");
- maths = double.Parse(Console.ReadLine());
- Console.Write("Въведете оценка по Физика: ");
- phys = double.Parse(Console.ReadLine());
- Console.Write("Въведете оценка по Химия: ");
- chem = double.Parse(Console.ReadLine());
- Console.Write("Въведете оценка по Биология: ");
- bio = double.Parse(Console.ReadLine());
- }
- public void getGrades() {
- averageGrade = (BEL + foreign + maths + phys + chem + bio) / 6;
- Console.WriteLine(averageGrade);
- }
- private double BEL, foreign, maths, phys, chem, bio;
- private double averageGrade;
- }
- public class Program
- {
- public static void Main()
- {
- Student ceci = new Student();
- Console.Write("Въведете името на ученика: ");
- ceci.name = Console.ReadLine();
- Console.Write("Въведете класа на ученика: ");
- ceci.grade = int.Parse(Console.ReadLine());
- Console.Write("Въведете номера на ученика: ");
- ceci.number = int.Parse(Console.ReadLine());
- ceci.setGrades();
- ceci.getGrades();
- }
- }
Add Comment
Please, Sign In to add comment