Gadget Corner, Huawei stock ROMs, Miracle Box, How To Install, Clone Firmware, Android Latest Version, HTC Firmware Flash File, and more information about gadgets for you

C# Program to find Student GPA and CGPA || Concept of ENUM in C#

C# Program to find Student GPA and CGPA || Concept of ENUM in C# - Welcome to the blog Gadget Corner we provide a lot of latest gadget information that must be very loss for you to miss, now we will discuss first about C# Program to find Student GPA and CGPA || Concept of ENUM in C# we have collected a lot of information to make this article complete for you, Ok please read::

You can also see our article on:


C# Program to find Student GPA and CGPA || Concept of ENUM in C#

C# Program to find Student GPA and CGPA

Program Statement:
Create a class of student which stores characteristcs of student like studentID, studentName, studentDOB, studentRollNo, studentEmail, studentGPA of last 5 semesters and other related information of the student. (You may set some properties Boolean and some readonly)
a. Calculate the CGPA of each student using function calculateCGPA(…).
b. Student with highest CGPA will be considerd CR of the class. There should be a function which will compare the CGPA of students and will declare a student having greater CGPA as CR.
c. Program should be able to take input of 5 students from user; definitely there will be a function which will take input from the user.
d. You have to use the Setter for setting the values of the data members of the class and and Getter function for getting the values of the data members of the class. (You can use property as alternative)
e. Default value for each student GPA should be 3.0. (You have to use an array for storing GPAs of last 5 semesters. You may simply initialize the array with 3.0 in constructor).
f. All data members should be private.
g. Member functions can be public.
h. Program must be able to add two objects i.e. if we add two students then all their corresponding data members will be added one by one. (Operator Overloading).
i. Program must contain explicitly definition of copy constructor.
j. StudentID and StudentGPA of last 5 semesters must be constant or readonly.
k. Value of studentGPA of last 5 semesters must be selected from ENUM which may contain values {1.0, 2.0, 3.0, and 4.0}.

Solution:
 public void Question_45()
{
int len = 0, i = 0, count = 0 , R , copy_r;
Student[] obj;
Console.Clear();
Console.WriteLine("****A Program Calculate the Student Characteristcs****\n");
Console.Write("\nEnter the Size of Student Class : ");
len = Convert.ToInt32(Console.ReadLine());
obj = new Student[len];
for (int j = 0; j < obj.Length; j++)
obj[j] = new Student();
do
{
Console.Clear();
Console.WriteLine("****A Program Calculate the Student Characteristcs****\n");
Console.WriteLine("\n\t\t1.Input Student Data");
Console.WriteLine("\t\t2.CGPA of Student");
Console.WriteLine("\t\t3.CR of Class");
Console.WriteLine("\t\t4.Copy Contructor");
Console.WriteLine("\t\t5.Operator Overload + ");
choice = Convert.ToChar(Console.ReadLine());
switch (choice)
{
case '1':
Console.Clear();
Console.Write("\nRoll No. : " + obj[i].R);
Console.Write("\n\nEnter Name : ");
obj[i].N = Convert.ToString(Console.ReadLine());
Console.Write("\nEnter Father Name : ");
obj[i].F = Convert.ToString(Console.ReadLine());
Console.Write("\nEnter Email : ");
obj[i].E = Convert.ToString(Console.ReadLine());
Console.Write("\nEnter Date of Birth : ");
obj[i].D = Convert.ToDateTime(Console.ReadLine());
Console.Write("\nEnter Smester : ");
obj[i].Sm = Convert.ToInt32(Console.ReadLine());
obj[i].Set_GPA();
i++;
count++;
break;
case '2':
if (count != 0)
{
int loc = -1;
Console.Clear();
Console.Write("\nEnter Roll No. of Student : ");
R = Convert.ToInt32(Console.ReadLine());
for (int k = 0; k < len; k++)
{
loc = obj[k].Check(obj, R);
if (loc != -1)
{
obj[loc].CGPA();
break;
}
}
if (loc == -1)
Console.WriteLine("\nInvalid Roll No.");
count++;
}
break;
case '3':
if (count != 0)
{
Console.Clear();
obj[0].CR(obj);
count++;
}
break;
case '4':
if (count != 0)
{
Console.Clear();
Console.Write("\nEnter the No. for Copy (i.e < 5/len) : ");
copy_r = Convert.ToInt32(Console.ReadLine());
Student copy = new Student(obj[copy_r-1]);
copy.Show();
count++;
}
break;
case '5':
if (count != 0)
{
Console.Clear();
Console.Write("\nEnter 2 Object No. for Adding (i.e < 5/len) : ");
Console.Write("\nEnter the Object No. for Adding : ");
R = Convert.ToInt32(Console.ReadLine());
Console.Write("\nEnter the Object No. for Adding : ");
copy_r = Convert.ToInt32(Console.ReadLine());
obj[R] = obj[R-1] + obj[copy_r-1];
obj[R].Show();
count++;
}
break;
}
Console.Write("\nIf Run Again (Y/N) ? ");
choice = Convert.ToChar(Console.ReadLine());
if (choice != 'Y' && choice != 'y')
{
Console.WriteLine("\nSee you Next Time");
Main_Fun();
break;
}
} while (true);
}



Articles about C# Program to find Student GPA and CGPA || Concept of ENUM in C# finished discussed

We think it is enough information about C# Program to find Student GPA and CGPA || Concept of ENUM in C#, hopefully the information we give can give benefit for you,

If you feel the information C# Program to find Student GPA and CGPA || Concept of ENUM in C# that we provide can provide benefits for others please share with link https://darellsfinancialcorner.blogspot.com/2014/01/c-program-to-find-student-gpa-and-cgpa.html thank you for visiting our blog page and do not forget to visit other

Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : C# Program to find Student GPA and CGPA || Concept of ENUM in C#

  • C# Simple Loop Program example to print charactersSimple Loop Problem to Print A B D H PProblem Statement:Write a program using for loop which prints the following output. (You have to find a pattern to print alphabetic ...
  • C# Program to solve different problemsC# Program to solve different problemsProgram Statement:Write a program which will take input a character ‘a’ value from user. You have to use switch statement to decide ...
  • Array Problem Solving using C#Array Problem Solving using C#Program Statement:Create two arrays student_rollno and student_marks, both of same size. First array will save the rollnos of students and ...
  • C# program to Check leap Year Using Conditional Statement C# program to Check Year is leap or not Using Conditional Statement Program Statement: Write a program using conditional operators to determine whether a year ...
  • C# Program for Array solving problemsC# Program for Array solving problemsProgram Statement:Write a function which takes four arrays of same size as arguments; array1, array2, array3, array4. The function w ...

1 komentar:

  1. It seems that this program is very difficult to write. But this is not the case. There are many courses on the internet that help you learn the language. After learning a language, the internet will help you to solve some stationary problems while writing your program. I find on the internet even specialized services 🖌 that help me write papers, not just google some basic questions.

    BalasHapus