Untitled
unknown
plain_text
2 years ago
1.3 kB
8
Indexable
using System;
namespace StudentGradingSystem
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the name of the student:");
string name = Console.ReadLine();
Console.WriteLine("Enter the marks for Subject 1:");
int mark1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the marks for Subject 2:");
int mark2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the marks for Subject 3:");
int mark3 = Convert.ToInt32(Console.ReadLine());
int total = mark1 + mark2 + mark3;
double average = total / 3.0;
string grade;
if (total > 200)
{
grade = "Excellent";
}
else if (total >=100)
{
grade = "Good";
}
else
{
grade = "Average";
}
Console.WriteLine($"Student Name: {name}");
Console.WriteLine($"Total Marks: {total}");
Console.WriteLine($"Grade Awarded: {grade}");
}
}
}
Editor is loading...
Leave a Comment