CS101 Assignment 3 2022 | CS101 Assignment 3 Solution (100% correct solution)

 


click on picture to visit youtube video to understand assignment

CS101 Assignment 3 2022

Code:

#include <iostream>

#include <string>


using namespace std;

int main(int argc, char** argv) {

string stdname = "ahmed";

string stdid= "bc21335";

int subject1=78;

int subject2=85;

int subject3=50;

int subject4=73;

int subject5=49;

int total_marks=500;     

float avg_marks;

    int obtmarks;

obtmarks=subject1+subject2+subject3+subject4+subject5;

cout<<"Student name: "<<stdname<<endl;

cout<<"Student id: "<<stdid<<endl;

cout<<"Obtained marks: "<<obtmarks<<"/"<<total_marks<<endl;

   

   avg_marks= (subject1+subject2+subject3+subject4+subject5)/5;

  cout<<"Average Marks: "<<avg_marks<<"%"<<endl;

if(avg_marks>=60)

{  

    cout<< "Division: First ";

}

else if(avg_marks>=45 && avg_marks<60)

{

cout<< "Dvision: Second";

}

  else if(avg_marks>=33 && avg_marks<45)

  {

  cout<< "Dvision: Third :";

}

else if (avg_marks<33)

      

{

       cout<< "Division:Fail:";

}



 

return 0;

}


CS101 Assignment 3 2022 | CS101 Assignment 3 Solution (100% correct solution)

Comments

Popular Posts