Professional Documents
Culture Documents
Assignment Solu-Of cs602 - 2024
Assignment Solu-Of cs602 - 2024
Solution :-
To create a program in Dev-C++ using the graphics.h library that fulfills the given
requirements, follow the steps below. Please note that the graphics.h library is specific to the
Borland compiler and might not work in other environments.
```cpp
#include <iostream>
#include <graphics.h>
#include <conio.h>
int main() {
// Display student ID
setfillstyle(SOLID_FILL, RED);
setfillstyle(SOLID_FILL, GREEN);
bar(startX + barWidth + barGap, startY, startX + 2 * barWidth + barGap, startY - percentageB * 2);
setfillstyle(SOLID_FILL, BLUE);
getch();
closegraph();
return 0;
```
"This program creates a bar chart representing the percentage scores for three subjects (A, B,
and C) based on user input. The bars adjust in height according to the marks provided,
maintaining the same colors and layout as in the given output sample. The student ID is
displayed at the specified position in the window."