I need this quick. Thanks. Store ten student names and their individual score in
ID: 3841170 • Letter: I
Question
I need this quick. Thanks.
Store ten student names and their individual score in a text file such as Notepad. There will be one score per student.
Write a C# program using Microsoft® Visual Studio® to retrieve the names and the scores. HAS TO BE A WINDOWS FORM APPLICATION (NOT A CONSOLE APPLICATION)
Display the student name with the highest score and the average score of the class.
Show what is being written in the new file.
Hint: You might consider adding delimiters between the data values in the original text file to simplify retrieving and processing the data.
Explanation / Answer
/* * C# Program to Generate the Marksheet of the Student */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Marksheet1 { class Program { static void Main(string[] args) { int r, m1, m2, m3, t; float p; string n; Console.WriteLine("Enter Roll Number :"); r = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Student Name :"); n = Console.ReadLine(); Console.WriteLine("Mark of Subject1 : "); m1 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Mark of Subject2 : "); m2 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Mark of Subject3 : "); m3 = Convert.ToInt32(Console.ReadLine()); t = m1 + m2 + m3; p = t / 3.0f; Console.WriteLine("Total : " + t); Console.WriteLine("Percentage : " + p); if (p >= 35 && p < 50) { Console.WriteLine("Grade is C"); } if (p >= 50 && p 60 && p 80 && pRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.