Answer to Question #313370 in C# for Jaynard zorilla

Question #313370

COMPUTE GRADE PROGRAM





Create a function named StudeInfo that will accept the following values from the user:





StudentID, StudentName, Course, Age, PrelimGrade, MidtermGrade, FinalTermGrade.







Create a function named ComputeGrade that will compute Final Average which is computed as the sum of PrelimGrade, MidtermGrade and FinalTermGrade divided by 3.







Display the output with the following format: (sample output)





*************************************************************************************





Student ID : 00-00-01





Student Name : FERNAN W. AMMAQUI

1
Expert's answer
2022-03-18T08:42:46-0400
using System;


namespace MathApp


{
    class Program
    {
        public static void StudeInfo(string StudentID, string StudentName, int Course, int Age,
            double PrelimGrade, double MidtermGrade, double FinalTermGrade )
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine($"Student ID: {StudentID}\n" +
                $"Student Name: {StudentName}\n" +
                $"Course: {Course}\n" +
                $"Age: {Age}");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine($"Prelim Grade: {PrelimGrade}\n" +
                $"Midterm Grade: {MidtermGrade}\n" +
                $"Final Term Grade: {FinalTermGrade}\n");
        }
        public static void ComputeGrade(double PrelimGrade, double MidtermGrade, double FinalTermGrade)
        {
            double average = (PrelimGrade + MidtermGrade + FinalTermGrade) / 3;
            if (average >= 60)
                Console.ForegroundColor = ConsoleColor.Blue;
            else
                Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"Average: {average}");
            Console.ForegroundColor = ConsoleColor.Green;
        }
        static void Main(string[] args)
        {
            StudeInfo("00-00-01", "FERNAN W. AMMAQUI", 2, 20, 90.0, 90.0, 90.0);
            ComputeGrade(90.0, 90.0, 90.0);
            StudeInfo("00-00-02", "FERNAN W. EDGEN", 2, 21, 59.0, 59.0, 59.0);
            ComputeGrade(59.0, 59.0, 59.0);
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS