Here is a sample program that I wrote using C# as my programming language that will ask the user to give the student name, subject, prelim, midterm and endterm grade and then our program will compute for the final grade of the student using C# in console environment.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace student_grade_solver
{
class grade_solve
{
static void Main(string[] args)
{
string student_name, subject;
double prelim = 0, midterm = 0, endterm = 0;
double final_grade = 0;
Console.Write("Student Grade Solver");
Console.Write("\n\n");
Console.Write("Student Name : ");
student_name = Console.ReadLine();
Console.Write("Subject : ");
subject = Console.ReadLine();
Console.Write("Prelim Grade : ");
prelim = Convert.ToDouble(Console.ReadLine());
Console.Write("Midterm Grade : ");
midterm = Convert.ToDouble(Console.ReadLine());
Console.Write("Endterm Grade : ");
endterm = Convert.ToDouble(Console.ReadLine());
final_grade = (prelim * 0.2) + (midterm * 0.3) + (endterm * 0.5);
Console.Write("\n\n");
Console.Write("===== DISPLAY REPORT =====");
Console.Write("\n\n");
Console.WriteLine(" Student Name : {0}. ",student_name);
Console.WriteLine(" Subject : {0}. ",subject);
Console.WriteLine(" Final Grade : {0:0}.",final_grade);
Console.Write("\n\n");
Console.Write("End of Program");
Console.ReadLine();
}
}
}
No comments:
Post a Comment