Help would be appreciated

Answer Listed:

include <iostream>//for input & output

include<string.h> //for string compare,case change,string length

include<math.h> //for round function

using namespace std;

int main() { //declaration of variables string weather="";; int classes=0; int tests=0; string weatherconv=""; int week; double maxcars=0,totalcars=0; double weatheradj=0,testadj=0;

//getting input cout<<"Please Enter the number of Classes Scheduled\n"; cinclasses; cout<<"\nPlease Enter the number of test Scheduled\n"; cintests; cout<<"\nPlease Enter the weather type: good or rainy/bad\n"; cinweather; cout<<"\nPlease Enter the semester week numer.Eg:for 1st week enter 1\n"; cinweek;

//maxcar calculation maxcars=(classes*24)/1.02;

//test adjustment calculation if(tests>15&&tests<30) testadj=(0.15*(classes*24)); else if(tests>30) testadj=(0.1(classes24));

//weather type converted to lower case to avoid errors due to mismatch of case for (int i=0; i<weather.length(); i++) weatherconv+= (char) tolower(weather[i]);

//weather adjustment calculation if(weatherconv.compare("good")==0) { if(week>=1&&week<=4) weatheradj=(0.1((0.12classes)+(classes/1.02))); else if(week>=5&&week>=11) weatheradj=(3/5)((0.12classes)+(50)); else if(week>=12&&week>=16) weatheradj=((1/5)*classes);

} else if(weatherconv.compare("bad")==0||weather.compare("rainy")==0) { if(week>=5&&week>=11) weatheradj=(classes+((1/4)classes))/(0.3classes); else if(week>=12&&week>=16) weatheradj=classes*0.05;

} //round function used to round of double variables to provide whole number answers maxcars=round(maxcars); weatheradj=round(weatheradj); testadj=round(testadj);

//total cars calculation totalcars=maxcars-weatheradj-testadj;

//printing input cout<<"\nInput\n"; cout<<"\nNumber of classes scheduled:"<<classes; cout<<"\nNumber of tests scheduled:"<<tests; cout<<"\nWeather type:"<<weather; cout<<"\nSemester Week:"<<week;

//printing output cout<<"\n\nOutput\n"; cout<<"\nMax cars:"<<maxcars; cout<<"\nWeather and semester week adjustment:"<<weatheradj; cout<<"\nTest adjustment:"<<testadj; cout<<"\nTotal Cars after adjustments:"<<totalcars; }

/r/FreeCheggRequests Thread