100% found this document useful (1 vote)
363 views2 pages

CS602 1 Solution 2024

Uploaded by

clashofclan3326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
363 views2 pages

CS602 1 Solution 2024

Uploaded by

clashofclan3326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS602 Assignment 1 Solution Spring 2024

Faisal Mehmood, Pakistan | Whatsapp +92 3208822590 | YouTube @Code-Pedia

#include <iostream>
#include <graphics.h>

int main() {

int gd = DETECT, gm;


initgraph(&gd, &gm, (char*)"");

int marksA, marksB, marksC;


cout << "Enter marks for Subject A (out of 100): ";
cin >> marksA;
cout << "Enter marks for Subject B (out of 100): ";
cin >> marksB;
cout << "Enter marks for Subject C (out of 100): ";
cin >> marksC;

// Draw student ID
settextstyle(BOLD_FONT, HORIZ_DIR, 2);
drawYAxisLabels();
outtextxy(250, 10, (char*)"BC170201473");

// Draw bars
drawBar(200, 400, marksA * 3, RED); // Subject A
drawBar(300, 400, marksB * 3, GREEN); // Subject B
drawBar(400, 400, marksC * 3, BLUE); // Subject C

// Draw horizontal line at the base of the bar


setcolor(WHITE);
line(150, 400, 450, 400);

// Draw subject labels


settextstyle(BOLD_FONT, HORIZ_DIR, 2);
outtextxy(210, 410, (char*)"A");
outtextxy(310, 410, (char*)"B");
outtextxy(410, 410, (char*)"C");

getch();
closegraph();
return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy