Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[2] Create a console application called MarksDemo and add two classes in it: Student and Mark. You are provided with the content of the Program.cs

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

[2] Create a console application called "MarksDemo" and add two classes in it: Student and Mark. You are provided with the content of the "Program.cs" file in the console application. Just click this link to download it. You must use it exactly as is. using System; Frequently Asked C programs in interview Graphics 52 -> Subject2 53 -> Subject3 Mathematical Programs namespace Mark Dene { class Program t -> total Matrix per -> percenta Miscellaneous nm -> name of div -> division static void Main(string[] args) { Student studenti = new Student) { Id = 1, Name = "Mark Brown" }; Student student2 = new Student (2, "Ann Brown'); AddMark (studenti, "Programing 1", 2, 80); AddMark(studenti, "Programing 2", 4, 90); AddMark (studenti, "Programing 3", 6, 70); My First Program Networking Number Programs C Progra Patterns AddMark(student2, "Programing 1", 2, 80); AddMark (student2,"Programing 2", 4, 110); AddMark (student2,"Programing 3", 6, 70); Pointer #includei #include + Name : string Methods + AddMark(courseName: string, numberOfCredits: int, grade: int) calculateGpa) : void + constructor Student) constructor Student(id: int, name: string) Create the following class members: [1] gpa is a private field containing the GPA of a student. [1] GPA is read only property providing the access to the gra field. [1] Id is auto implemented property representing student id. [1] Name is auto implemented property representing student name. [1] Marks is auto implemented read only property that contains a list of Mark objects. [1] A public parameterless constructor that initialize Marks property. [1] A constructor that takes 2 parameters: student id and the name and assigns their values to appropriates properties. [1] Make sure that there is no code duplication in the constructors. [2] calculate Gea method calculates the student's GPA based on the current marks and assign it to the appropriate class member. GPA is calculated as the sum of weighted grades divided by sum of credits. The weighted grade is calculated by multiplying a course grade by number of the course credits. [2] AddMark method has 3 parameters: course name, number of credits and grade. The method will create the Mark object, assigns the grade to the appropriate property, adds it to the list of marks for a student. Mark object is only added to the list of marks if the grade is assigned. i.e. there is no exception caused by prade outside of range. : void + calculateGpa)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions