| | |
need serious help!!!!!!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
i have made an electricity bill program and wants to add graphics in it
mean when it need input from user it writes in graphics.............
so plz help me in making this.......
mean when it need input from user it writes in graphics.............
so plz help me in making this.......
C++ Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> #include<iostream.h> void main() { int unit=3; int reading,previous,current,consumed,bill; cout<<"enter your meter no"; cin>>reading; cout<<"enter previous redaing of meter"; cin>>previous; cout<<"enter current reading of meter"; cin>>current; consumed=current-previous; cout<<"units used in this month="<<consumed<<endl; bill=consumed*unit; cout<<"total bill="<<bill<<"Rs"; getch(); closegraph(); }
Last edited by Ancient Dragon; May 7th, 2008 at 7:36 pm. Reason: replaced quote tags with code tags
You mean a GUI program? If MS-Windows you have to write a windows program, not a console program. Here is a simple introduction tutorial. It requires a basic knowledge/understanding of C ir C++ language.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
I changed some bits but, hey, it works for me.
I use Dev-C++
Try this:
I use Dev-C++
Try this:
C++ Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> #include<iostream> #include<windows.h> using namespace std; int main() { int unit=3; int reading,previous,current,consumed,bill; cout<< "Enter your meter Number:\a"; cin>>reading; cout<<"Enter previous redaing of meter:\a"; cin>>previous; cout<<"Enter current reading of meter:\a"; cin>>current; consumed=current-previous; cout<<"Units used in this month="<<consumed<<endl; bill=consumed*unit; cout<<"Total bill="<<bill<<"Rs"; getch(); return 0; }
C programmers will get smashed by C++ programmers.
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
graphics mean it should appear in differnt colours means it looks like origional electricity bill on screen thats what i mean .........look at this program i cannot able to print input from user in this page...plz help....
C++ Syntax (Toggle Plain Text)
#include<stdio.h> #include<stdlib.h> #include<conio.h> #include<graphics.h> #include<iostream.h> void main( ) { int gd = DETECT, gm, maxx, maxy; initgraph ( &gd, &gm, "c:\\tc\\bgi" ) ; maxx = getmaxx( ) ; maxy = getmaxy( ) ; rectangle ( 0, 0, maxx, maxy ) ; settextstyle(0,0,3); setcolor ( 10 ) ; outtextxy ( 250,50, "WAPDA" ) ; settextstyle(0,0,2); outtextxy (270,80,"LESCO"); settextstyle (0,0,1); outtextxy(100,120,"METER NO"); settextstyle(0,0,2); outtextxy(400,200,"SAVE ENERGY"); outtextxy(385,230,"SAVE PAKISTAN"); getch (); closegraph(); }
Last edited by Ancient Dragon; May 11th, 2008 at 9:32 am. Reason: replaced quote tags with code tags
![]() |
Other Threads in the C++ Forum
- Previous Thread: Help me extract frames from mp4
- Next Thread: Compare a string with a file.
| Thread Tools | Search this Thread |
api array beginner bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion count database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






