Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++: PROGRAM SPECIFICATIONS Using separate source (Student.cpp) and header files (Student b) create a class to represent students according to the following specifications (use

IN C++:

image text in transcribedimage text in transcribedimage text in transcribed

PROGRAM SPECIFICATIONS Using separate source (Student.cpp) and header files (Student b) create a class to represent students according to the following specifications (use the method and attribute names as given here): The Student.h header file (you may not alter this file and you must submit it with your code): #pragma once #include #include using namespace std; class Student private: string major; int credits; public: Student(string m = "General Studies", int c = 0); Student (Student& s); Student); const string getMaior); const int setCredits...); const void getStatus (string& m, int& c); void setMajorstring m); void setCredits(int c); void setStatus(string m, int c); string displayStudent); 1. Fields a. -major: String b. -credits: int 2. Methods (no additional ones may be created), all public a. parameterized constructor with initialized parameters i. sets major to "General Studies" ii. sets credits to 0 1. Note that these are both set in the prototype, but not in the cpr file 2. In the .cpp file you should be setting major and credits to the input from the parameters iii. displays:_"Constructor has been called! " b. copy constructor that performs a deep copy i. assign the passed in object's fields to the new object's fields C. destructor i displays "Destructor called for major! " 1. where is replaced with the appropriate value ii. sets major to "None" 111. sets credits to -1 d. const string getMaier i. returns major e const int getCredits. i. returns credits f. const void getStatus i. returns both credits and major by reference g. void setMaior i. takes one string parameter ii. sets major to parameter value h. void setCredits i. takes one int parameter ii. sets credits to parameter value i. void setStatus i. take one int and one string parameter ii. sets both credits and major to respective parameter values j. string displayStudent i. takes no parameters ii. returns a string 1. "I'm a major and have completed credit hours. " 2. where and are replaced with the appropriate values 3. Main Function (this goes in its own source file Main.cpp) a. Declare a single student object, s1, during declaration initialize it to have the major "Computer Science i do not provide a value for number of credit hours ii. call the displayStudent from si object to print its data to screen b. declare a vector of 5 objects of the student class i. Ask the user to input the major and credit hours for each student ii. Verify that the credit hours are >=0 iii. Use an iterator to call the displayStudent function for each student object in the vector after you have collected and set all of the input UML: CLASS AND USE CASE DIAGRAMS Write a UML class diagram for the Student class. Make sure to include all class diagram information: 1. Class Name 2. Fields with data types and access modifiers 3. Methods with return types, parameter names and data types, and access modifiers Write a Use Case Diagram based upon the following specification for four use cases all of which are invoked by a Student A Students is able to register for a class which is then handled by the Registrar. A Student can also withdraw from a class which is then handled by the Registrar. A Student can choose to attend a class which is offered by a Teacher. A Student can also take an exam which is monitored by a Teacher. DELIVERABLES Please upload the following to Canvas for Lab 3: 1. Lab 3 Word .doc Containing: a. Problem Statement b. UML Diagrams i. Class Diagram ii. Use Case Diagram C. Test Plan d. Screenshots proving program works 2. Lab 3 Source Files Note: Failure to upload your spp and h files will result in a 0 for the code portion of the grade on the assignment. PROGRAM SPECIFICATIONS Using separate source (Student.cpp) and header files (Student b) create a class to represent students according to the following specifications (use the method and attribute names as given here): The Student.h header file (you may not alter this file and you must submit it with your code): #pragma once #include #include using namespace std; class Student private: string major; int credits; public: Student(string m = "General Studies", int c = 0); Student (Student& s); Student); const string getMaior); const int setCredits...); const void getStatus (string& m, int& c); void setMajorstring m); void setCredits(int c); void setStatus(string m, int c); string displayStudent); 1. Fields a. -major: String b. -credits: int 2. Methods (no additional ones may be created), all public a. parameterized constructor with initialized parameters i. sets major to "General Studies" ii. sets credits to 0 1. Note that these are both set in the prototype, but not in the cpr file 2. In the .cpp file you should be setting major and credits to the input from the parameters iii. displays:_"Constructor has been called! " b. copy constructor that performs a deep copy i. assign the passed in object's fields to the new object's fields C. destructor i displays "Destructor called for major! " 1. where is replaced with the appropriate value ii. sets major to "None" 111. sets credits to -1 d. const string getMaier i. returns major e const int getCredits. i. returns credits f. const void getStatus i. returns both credits and major by reference g. void setMaior i. takes one string parameter ii. sets major to parameter value h. void setCredits i. takes one int parameter ii. sets credits to parameter value i. void setStatus i. take one int and one string parameter ii. sets both credits and major to respective parameter values j. string displayStudent i. takes no parameters ii. returns a string 1. "I'm a major and have completed credit hours. " 2. where and are replaced with the appropriate values 3. Main Function (this goes in its own source file Main.cpp) a. Declare a single student object, s1, during declaration initialize it to have the major "Computer Science i do not provide a value for number of credit hours ii. call the displayStudent from si object to print its data to screen b. declare a vector of 5 objects of the student class i. Ask the user to input the major and credit hours for each student ii. Verify that the credit hours are >=0 iii. Use an iterator to call the displayStudent function for each student object in the vector after you have collected and set all of the input UML: CLASS AND USE CASE DIAGRAMS Write a UML class diagram for the Student class. Make sure to include all class diagram information: 1. Class Name 2. Fields with data types and access modifiers 3. Methods with return types, parameter names and data types, and access modifiers Write a Use Case Diagram based upon the following specification for four use cases all of which are invoked by a Student A Students is able to register for a class which is then handled by the Registrar. A Student can also withdraw from a class which is then handled by the Registrar. A Student can choose to attend a class which is offered by a Teacher. A Student can also take an exam which is monitored by a Teacher. DELIVERABLES Please upload the following to Canvas for Lab 3: 1. Lab 3 Word .doc Containing: a. Problem Statement b. UML Diagrams i. Class Diagram ii. Use Case Diagram C. Test Plan d. Screenshots proving program works 2. Lab 3 Source Files Note: Failure to upload your spp and h files will result in a 0 for the code portion of the grade on the assignment

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

Students also viewed these Databases questions

Question

Briefly explain at least five different ways of assessing truth.

Answered: 1 week ago