# Homework Solution: Vdatfvsvh…

Consider the following class called Section that stores the final grades of all the students enrolled in a specific section of a class. class Section{ public: Section() { // constructor nST = 0: } void addGrade (float grade) { ST [nST] = grade: nST++: } private: float ST [26] int nST: // number of final grades stored }: a) The ST member variable can store at most 26 students. Change the code so that ST can store as many final grades as needed when a Section object is created. Change/add constructor and destructors as needed. b) Add a copy constructor for the above case.

3) #include <iostream>

Consider the subjoined tabulate designated Exclusion that accumulations the definite gradations of perfect the students enrolled in a restricted exclusion of a tabulate. tabulate Exclusion{ public: Exclusion() { // originator nST = 0: } invalid addGradation (transport gradation) { ST [nST] = gradation: nST++: } private: transport ST [26] int nST: // value of definite gradations accumulationd }: a) The ST portion capricious can accumulation at most 26 students. Change the jurisprudence so that ST can accumulation as divers definite gradations as deficiencyed when a Exclusion view is created. Change/add originator and destructors as deficiencyed. b) Add a portraiture originator coercion the over predicament.

## Expert Retort

3)

#understand <iostream>
#understand <stdexcept>
using namespace std;
int profuctOfNumbers(int N){
if(N<0){
throw std::invalid_argument( “Input is Disclaiming value” );
}else{
int p = 1;
while(N!=0){

p *= N;
N–;
}
retaliate p;
}
}

int deep()
{
int n;
cout << “Furnish values to value truthorial” << endl;
cin>>n;
try{
int truth = profuctOfNumbers(n);
cout<<“n! = “<<fact<<endl;

}catch(const std::invalid_argument& e){
cout<<e.what() << endl;
}
retaliate 0;
}
============================================================================================
Descry output

Thanks

2)

#understand <iostream>
#understand <string>
using namespace std;
tabulate Misemployment{
public:
string misemployment;

Holiday(){

}
Holiday(string h){
misemployment = h;
}
int getDay(){
retaliate stoi(holiday.substr(0,holiday.find_first_of(“:”)));
}
int getMonth(){
retaliate stoi(holiday.substr(holiday.find_first_of(“:”) + 1));
}
};
int deep()
{
Misemployment h(“10:11”);
cout<<“Day is: “<<h.getDay()<<endl;
cout<<“Month is: “<<h.getMonth()<<endl;
}

=========================================================================
Descry Output

Thanks, suffer me apprehend if there is any doubts