google.com, pub-3534375712831849, DIRECT, f08c47fec0942fa0 CS101 Assignment 2 Solution Spring 2023 | Download solution in PDF from Website Free Assignment / GDB
Latest Updates
Loading...

CS101 Assignment 2 Solution Spring 2023 | Download solution in PDF from Website Free Assignment / GDB




CS101 ASSIGNMENNT NO.2

ID: ABDUL HADI E SERVICE

 

SOLUTION:

CODE


#include <iostream>

#include <string>

using namespace std;

 

int main() {

    string vuID;

    int csMarks, mathMarks, pakStudyMarks, mgtMarks;

   

    cout << "Enter your VU-ID: ";

    cin >> vuID;

 

    cout << "Enter marks for CS: ";

    cin >> csMarks;

   

    cout << "Enter marks for Math: ";

    cin >> mathMarks;

   

    cout << "Enter marks for Pak Study: ";

    cin >> pakStudyMarks;

   

    cout << "Enter marks for MGT: ";

    cin >> mgtMarks;

   


    int totalMarks = csMarks + mathMarks + pakStudyMarks + mgtMarks;

    double averageMarks = totalMarks / 4.0;

   

    cout << endl;

    cout << "-----------------------------" << endl;

    cout << "VU-ID: " << vuID << endl;

    cout << "Total Marks: " << totalMarks << endl;

    cout << "Average Marks: " << averageMarks << endl;

    cout << "Final Grade: ";

   

    if (averageMarks >= 91 && averageMarks <= 100) {

        cout << "A+" << endl;

    } else if (averageMarks >= 81 && averageMarks < 91) {

        cout << "A-" << endl;

    } else if (averageMarks >= 71 && averageMarks < 81) {

        cout << "B+" << endl;

    } else if (averageMarks >= 61 && averageMarks < 71) {

        cout << "B" << endl;

    } else if (averageMarks >= 51 && averageMarks < 61) {

        cout << "C" << endl;

    } else if (averageMarks >= 41 && averageMarks < 51) {

        cout << "D" << endl;

    } else if (averageMarks >= 35 && averageMarks < 41) {

        cout << "E" << endl;

    } else {

        cout << "Fail" << endl;

    }

   

    cout << "-----------------------------" << endl;

   

    return 0;

}

 

 

 

Output Screen Shot:






Download the Question File and Solution

Download File Now 

 

Get Paid Services (Word Ready File)






Want more info, please press the below button




`

Post a Comment

0 Comments