A high-level view of an application is shown below. You will build a system by precisely following the specifications be

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

A high-level view of an application is shown below. You will build a system by precisely following the specifications be

Post by answerhappygod »

A high-level view of an application is shown below. You willbuild a system by precisely following the specifications below. Asample output is provided at the end of this document. You mustmatch the format of the output as close as possible.Do not use theclass diagram below or even the UML object diagram to develop yourcode. Please read the specification/description of each typeincluding all the members before starting to implement thesystem.It is recommended that you implement each type in the orderthat they are specified.
The Course struct is described in the diagrambelow.
Course
struct
Fields
Properties
+ «property»Code
+ «property»Hours
: string
: int
Methods
+ «constructor»Course(
code : string
hours :int)
+ ToString()
: string
The StudentStatus enum is described in thediagram below.
StudentStatus
enum
Constants
Fulltime GraduatedSuspended
Constants:
There are three constants.
Fulltime.Graduated. Suspended.
The IStudent interface comprise of two membersthat are described in the diagram below.
IStudent
interface
Properties
Methods
Add(course :Course ) : voidDrop(course :Course ) :void
Description of class members
The Student class implements theIStudent interface and is described in the diagrambelow.
Student
class
Fields
Properties
+
«property» Name
:
string
+
«property» Status
:
StudentStatus
+
«property» Courses
:
<List>Course
Methods
+
«constructor» Pet(
name
: string,
status :StudentStatus,
course :Course)
+
Drop(course:Course)
:
void
+
Add(course:Course)
:
void
+
ToString()
:
string
collection.
Copy the following into your main method and write the missingstatements.
Console.WriteLine("Creating a course");//write the statements to create a course//object and print it
Console.WriteLine("Creating a student");//write the statements to instantiate the//Student class and display the//resulting object
Console.WriteLine("\n\nAdding a few courses to the studentobject");//write the statements to add 3 courses to - 2marks//the current student and then print it
string startswith = "COMP";Console.WriteLine($"\n\nDisplaying all {startswith}courses");//write the statements to filter out only - 2marks//the required courses from the Courses collection//Hint: use the StartsWith() of the string class
Console.WriteLine($"\n\nDropping \"{comp100}\"");//write the statements to drop the first//course from the student objects
string filename = "student.json";Console.WriteLine($"\n\nSerializing the student object to the file{filename}");//write the statements to save the - 2marks//current collection to a file
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply