Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program in C# 1. Create an abstract class Student.cs. o 3 public string data members: firstName, lastName, studentID. o Create a constructor to

Create a program in C#

1. Create an abstract class Student.cs.

o 3 public string data members: firstName, lastName, studentID.

o Create a constructor to initialize each data member value.

o Create read-only property for each data member.

o Create an abstract method ImportantThing(), returns string.

2. Create an Interface IMathClass.cs. Declare a method Math(), returns string.

3. Create classes ElementarySchoolStudent.cs, MiddleSchoolStudent.cs,

HighSchoolStudent.cs, CollegeStudent.cs, inherit Student.cs and IMathClass.cs to each

of them.

ElementarySchoolStudent.cs

o Constructor with three parameters for firstName, lastName, studentID.

o ImportantThing() returns "Farm field trip!".

o Math() returns "Basic Math."

o Override toString().

MiddleSchoolStudent.cs

o Constructor with three parameters for firstName, lastName, studentID.

o ImportantThing() returns "Summer Camp!".

o Math() returns "Geometry."

o Override toString().

HighSchoolStudent.cs

o Constructor with three parameters for firstName, lastName, studentID.

o ImportantThing() returns "SAT exam.".

o Math() returns "Basic Algebra."

o Override toString().

CollegeStudent.cs

o Constructor with three parameters for firstName, lastName, studentID.

o ImportantThing() returns "Major.".

o Math() returns "Advanced Algebra.".

o Override toString().

4. In Program.cs, in method main(), create an Student type array with size of 4.

o First element is ElementarySchoolStudent object with any first name, last name, student

ID for constructor.

o Second element is MiddleSchoolStudent object with any first name, last name, student

ID for constructor.

o Third element is HighSchoolStudent object with any first name, last name, student ID for

constructor.

o Fourth element is CollegeStudent object with any first name, last name, student ID for

constructor.

o for loop to go through array, call .toString for each object.

OTPUT

image text in transcribed

Ny name is Sanuel Clark, an an Elenentary school student, Will have an exciting Farm field trip!, Iwill learn Basic Math name is David Hunt, I am a niddle school student. vill have aSunner Carp!, I will learn Geometry, My name is Mary Anderson, I an high school student. I will take SAT exam,, I learn Basic Algebra, My name is Tim Russell, I am a college student, I have a Major,, I learn Advanced Algebra, Press any key to continue Student FirstName IMath Class Last Name String Math() StudentID abstract importantThing0 Middle SchoolStudent High SchoolStudent CollegeStudent Elementary SchoolStudent FirstName FirstName FirstName FirstName LastName Last Name Last Name LastName StudentID StudentID StudentID StudentID ImportantThing0 ImportantThing0 ImportantThing0 ImportantThing0 Math() Math() Math() Math()

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago