Question

In: Computer Science

Write a Program for Examination depart of your college. Program should take these inputs Name, Roll...

Write a Program for Examination depart of your college. Program should take these inputs
Name, Roll No, Faculty, and All 4 Subjects Marks. After that Clear the Console Screen & Print
an eye-catching Mark sheet. This is showing Name, Roll No, Faculty, All 4 Subjects Marks,
Total Marks, Percentage, Grade and Remarks.
Follow below criteria for Grade & Remarks

Percentage Grade Remarks
>= 87 A Excellent
78 - 86 B+ Good
72 – 77 B Good
66 – 71 C+ Not Good
60 – 65 C Not Good
<= 59 F Very Bad

(Note Use Switch Case for Remarks)

C#

Solutions

Expert Solution

Code :-

using System;
                                        
public class Program
{
        public static void Main()
        {
                Console.WriteLine("-----------------------------------------------------");
                Console.WriteLine("-------------- Examinaion Mark Sheet ----------------");
                Console.WriteLine("-----------------------------------------------------");
                Console.WriteLine("Please Enter the following details.");
                Console.Write("Name: ");
                var name = Console.ReadLine();
                Console.Write("Roll Number: ");
                var rnumber = Console.ReadLine();
                Console.Write("Faculty: ");
                var faculty = Console.ReadLine();
                Console.Write("Maths marks: ");
                long sub1 = Convert.ToInt64(Console.ReadLine());
                Console.Write("English marks: ");
                long sub2 = Convert.ToInt64(Console.ReadLine());
                Console.Write("Science marks: ");
                long sub3 = Convert.ToInt64(Console.ReadLine());
                Console.Write("Computer marks: ");
                long sub4 = Convert.ToInt64(Console.ReadLine());
                
                var totalmarks = sub1+sub2+sub3+sub4;
                long percentage = Convert.ToInt64(totalmarks/4);
                var grade = "";
                var remarks = "";
                var option = "";
                if(percentage>= 87){
                        option = "1";
                }
                else if(percentage >= 78 && percentage <=86){
                        option = "2";
                }
                else if(percentage >= 72 && percentage <=77){
                        option = "3";
                }
                else if(percentage >= 66 && percentage <=71){
                        option = "4";
                }
                else if(percentage >= 60 && percentage <=65){
                        option = "5";
                }
                else{
                        option = "6";
                }
                switch(option)
                {
                        case "1":
                                grade = "A";
                                remarks = "Excellent";
                                break;
                        case "2":
                                grade = "B+";
                                remarks = "Good";
                                break;
                        case "3":
                                grade = "B";
                                remarks = "Good";
                                break;
                        case "4":
                                grade = "C+";
                                remarks = "Not Good";
                                break;
                        case "5":
                                grade = "C";
                                remarks = "Not Good";
                                break;
                        default:
                                grade = "F";
                                remarks = "Very Bad";
                                break;
                }
                        
                
                Console.Clear();
                
                Console.WriteLine("-----------------------------------------------------");
                Console.WriteLine("-------------- Examinaion Mark Sheet ----------------");
                Console.WriteLine("-----------------------------------------------------");
                Console.WriteLine();
                Console.WriteLine("Name:    "+name);
                Console.WriteLine("Roll no: "+rnumber );
                Console.WriteLine("Faculty: "+faculty);
                Console.WriteLine();
                Console.WriteLine("+-----------+----------");
                Console.WriteLine("|Maths      | "+sub1+"/100");
                Console.WriteLine("+-----------+----------");
                Console.WriteLine("|English    | "+sub2+"/100");
                Console.WriteLine("+-----------+----------");
                Console.WriteLine("|Science    | "+sub3+"/100");
                Console.WriteLine("+-----------+-----------");
                Console.WriteLine("|Computer   | "+sub4+"/100");
                Console.WriteLine("+-----------+------------");
                Console.WriteLine("|Total Marks| "+(totalmarks)+"/400");
                Console.WriteLine("+-----------+------------");
                Console.WriteLine("|Percantage | "+(percentage)+"%");
                Console.WriteLine("+-----------+------------");
                Console.WriteLine("|Grade      | "+grade);
                Console.WriteLine("+-----------+------------");
                Console.WriteLine("|Remarks    | "+remarks);
                Console.WriteLine("+-----------+------------");
                Console.WriteLine();
                Console.WriteLine("-----------------------------------------------------");
        }
}

Output :-

  1. Input values:-

2. Marksheet output :-


Related Solutions

Create a form with two inputs name and roll number.And write a script to validate the...
Create a form with two inputs name and roll number.And write a script to validate the inputs.Any of them should not be empty. Name will be string and roll number will be number between 1 -10 only
Write a program in C++ to implement Lamport’s logical clocks. Your program should take as input...
Write a program in C++ to implement Lamport’s logical clocks. Your program should take as input a description of several process schedules (i.e., lists of send, receive or print operations). The output of your program will be a linearization of these events in the order actually performed, annotated with Lamport clock values. The input of the program will be a collection of processes, each with a list of operations to perform. The processes are named p1...pn for some n (you...
Write a Java program to implement a Single Linked List that will take inputs from a...
Write a Java program to implement a Single Linked List that will take inputs from a user as Student Names. First, add Brian and Larry to the newly created linked list and print the output Add "Kathy" to index 1 of the linked list and print output Now add "Chris" to the start of the list and "Briana" to the end of the list using built-in Java functions. Print the output of the linked list.
Write a function of interest to you. It should that take at least 3 inputs from...
Write a function of interest to you. It should that take at least 3 inputs from different types and return at least three different values. Call your function from the main. Print the resultant outputs in the main (not in the function).
Write a c++ program that inputs a time from the console. The time should be in...
Write a c++ program that inputs a time from the console. The time should be in the format “HH:MM AM” or “HH:MM PM”. Hours may be one or two digits. Your program should then convert the time into a four-digit military time based on a 24-hour clock. Code: #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string input; cout << "Enter (HH:MM XX) format time: "; getline(cin, input); int h, m; bool am; int len =...
java Write a recursive program to reverse a positive integer. . Your method should take a...
java Write a recursive program to reverse a positive integer. . Your method should take a non negative integer as a parameter and return the reverse of the number as an integer. e.g. if you pass 12345, your method should return 54321.
After graduating from college with your MBA, you decide to take your grandma’s secret cinnamon roll...
After graduating from college with your MBA, you decide to take your grandma’s secret cinnamon roll recipe and open up a bakery. You grew up devouring your grandma’s rolls, and you have convinced her to give you the secret. You are confident that your bakery will be the next big hit in the fast-food business. You take out a business loan for the maximum amount your bank will give you, hire several employees, and open a beautiful store that is...
Write a program, circleref.cpp, that inputs a double radius of circle. It should print, given this...
Write a program, circleref.cpp, that inputs a double radius of circle. It should print, given this radius, the circumference of the circle, the area of the circle, the surface area of a sphere with that radius and the area of a sphere with that radius. Each of its computation functions returns its answers in call by reference parameters. Here are the formulas for computation: Circumference = 2 • π • r Circle Area = π • r2 Sphere Surface Area...
Write a C++ die roller program. We need you to write a program that will roll...
Write a C++ die roller program. We need you to write a program that will roll dice for them, but not just six-sided dice. Your program needs to be able to take an input in for form nDx or ndx where the d is the letter d or D. n may or not be present. If it is, it represents the number of dice. If not, assume it is a 1. x may or may not be present. If it...
Write a program Write a program whose inputs are three integers, and whose output is the...
Write a program Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 C++ please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT