Click here to Skip to main content
15,749,066 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The program will take the input from the user for the course name and obtain marks. After taking the 6 inputs the program will draw a bar chart by labeling the bars of the bar chart according to the subject name.
The title bar of the graphic window must show your student ID.

What I have tried:

#include <graphics.h>
#include <conio.h>
#include <iostream>
 using namespace std;

int main()
    string Subject1, Subject2, Subject3;
    int number1, number2, number3;
    cout<<"Enter the First Subject::";
    cout<<"Enter the Number of Subject::";
    cout<<"Enter the Second Subject::";
    cout<<"Enter the Number of Subject::";
    cout<<"Enter the Third Subject::";
    cout<<"Enter the Number of Subject::";
    int gd = DETECT, gm;
    initgraph ("&gd, "&gm, "X:\\TC\\BGI);

    //here add your student id
    /*Draw on X and on Y Axis*/
    line (90,400,90,50);

   /*Draw bars on screen*/
    return 0;
Updated 11-Dec-22 10:48am
Rick York 11-Dec-22 19:38pm    
Do you have a question?

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
And the code you show has almost nothing to do with the question you were set...

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
Share this answer
The program is tagged as C++, but the includes as well as the graphics commands used indicate a very special version. It would help if it were specified here exactly what it is, under which operating systems it is supposed to run. Also missing is the information what the problem is here and where help is needed.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900