google.com, pub-3534375712831849, DIRECT, f08c47fec0942fa0 CS101 Assignment 3 Solution Download in PDF Free
Latest Updates
Loading...

CS101 Assignment 3 Solution Download in PDF Free




Question: Write a C++ program that calculates the total marks and average marks obtained by a student in five subjects and also computes the division based on the average marks. You are required to enter the marks for each subject out of 100 marks. The output screen should show your name and student id (VU ID), obtained marks, average marks, and division as shown in the output diagram (given below):

 

Use the division system mentioned below to compute the Division using the if-else structure.

Greater than or equal to 60                                                                 First Division

Greater than or equal to 45 but less than 60                                      Second Division

Greater than or equal to 33 but less than 45                                       Third Division

And in case marks are less than 33%                                                 Fail

 

Solution:
Code:
#include <iostream>
using namespace std;
main()
{
string name = "Abdul Hadi E Services";
string id1 = "BC";
int id2 = 21040000;
int Obtained, total_Marks;
int per;
int s1, s2, s3, s4, s5;
s1 = 70;
s2= 40;
s3= 20;
s4 = 70;
s5= 20;
total_Marks=500;

 

Obtained=s1+s2+s3+s4+s5;
per = (Obtained*100)/total_Marks;
cout <<"Student Name : " <<name <<"\n";
cout<<"Student ID : "<<id1<<id2<<"\n";
cout<<"Obtained Marks : "<<Obtained <<"/"<<total_Marks <<"\n";
cout<<"Average Marks : " <<per <<" %" <<"\n";
if (per>=60)
cout<<"Division: First"; }
else if (per>=45 && per<=60)
{
cout<<"Division: Second"; }
else if (per>=33 && per<=59)
{
cout<<"Division: Third";}
else
{
cout<<"Division: Fail";}
}

 

Output:


 

Download in PDF CS101 Assignment 3 Solution

Download File Now

Watch Full Video to learn how change and submit




Want more info, please press the below button




`

Post a Comment

0 Comments