any easy tutorials which teach u how to make a window math program from scratch?
any easy tutorials which teach u how to make a window math program from scratch?
Last edited by DDX; 03-19-2005 at 03:17 PM.
- "Problem Solving C++, The Object of Programming" -Walter Savitch
- "Data Structures and Other Objects using C++" -Walter Savitch
- "Assembly Language for Intel-Based Computers" -Kip Irvine
- "Programming Windows, 5th edition" -Charles Petzold
- "Visual C++ MFC Programming by Example" -John E. Swanke
- "Network Programming Windows" -Jones/Ohlund
- "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
- "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel
ill start reading it but its a window(not bill gates windows) application not console application right?
This is not a DOS console application.. It's a pretty good tutorial about how to create a basic window using the Windows32 API. Basically, you'll set a bunch of attributes of a windows structure.. and register it with windows. Windows will interact with your program by sending messages to your program (in the form of WM_Message) which you will handle using a swtich/case structure.
Examples:
If the window is being resized, windows will issue WM_SIZE and WM_REPAINT messages
If the user clicks the red X, windows will issue a WM_DESTROY message
it's up to your program to handle these messages and react accordingly
Last edited by The Brain; 03-19-2005 at 03:33 PM.
- "Problem Solving C++, The Object of Programming" -Walter Savitch
- "Data Structures and Other Objects using C++" -Walter Savitch
- "Assembly Language for Intel-Based Computers" -Kip Irvine
- "Programming Windows, 5th edition" -Charles Petzold
- "Visual C++ MFC Programming by Example" -John E. Swanke
- "Network Programming Windows" -Jones/Ohlund
- "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
- "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel
Aha....i understood everything u said.....i hope ill manage to get something outta it.
k ........ myself......im too stupid...i tried understanding the whole thing since last 2 months when i heard about such thing and i wont understand now either......well ill go jump off a cliff
Last edited by DDX; 03-19-2005 at 03:30 PM.
LOL I look forwad to your post, cause you really cheer me up!
Thanks,
By the way I am curious if you can't programme, why are you trying to write a windows programme? I mean you need to know how to write console programmes first and your trying to write something more advanced.
i just need a window program and im trying to learn but i get the first 3 tuts ut dunno what to do then....i just cant get it and im trying.
hmm k heres a tough one.
whats the code to make a console app know some aquivalents like this
7ap = 7p , p = 0,50
and what if i want to remember more than 1 aquation?
like
7*a*p = 7*p , p = 0,50
5*b*q = 5*q , q = 0,40
5*c*e = 5*e , e = 0,70
Last edited by DDX; 03-19-2005 at 03:52 PM.
I dont get it what are you trying to write? a calculator ? if you have msn add me [email protected] i have some good WIN32 calculator examples that you might want.
well the code has a problem and i cant find out what, pls HELP me fix it:
Code:#include <iostream> using namespace std; int main() { double operand1; double operand2; double operand3; double operand4; double operand5; double difference1; double difference2; double difference3; double difference4; double sum1; double sum2; double sum3; double sum4; cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein:\n"; operand1 = readDouble(); difference1 = (7 - operand1); printLine<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugenbrötchen ein:\n"; operand2 = readDouble(); difference2 = (5 - operand2); printLine<<"Geben Sie bitte der Anzahl der übrig gebliebene Käsestangen ein:\n"; operand3 = readDouble(); difference3 = (5 - operand3); printLine("Geben Sie bitte der Anzahl der übrig gebliebene Laugencroissants ein:\n"; operand4 = readDouble(); difference4 = (5 - operand4); sum1 = (difference1 + difference2 + difference3 + difference4); printLine("Geben Sie bitte Kassenstand am Ende in € ein:\n"; operand5 = readDouble (); double product1 = (difference1 * 0.50); double product2 = (difference2 * 0.40); double product3 = (difference3 * 0.70); double product4 = (difference4 * 0.65); sum2 = (10 + product1 + product2 + product3 + product4); sum3 = (operand1 * 0.50 + operand2 * 0.40 + operand3 * 0.70 + operand4 * 0.65); sum4 = (7 * 0.50 + 5 * 0.40 + 5 * 0.70 + 5 * 0.65 + 10); printLine("Kassenstand wenn alles verkauft worden sein würde: " +sum4); printLine("So viel Geld müssen Sie in die Kasse haben: " +sum2); printLine("Preis der übrig gebliebene Waren: " +sum3); printLine("Aktuelle Kassenstand am Ende: " +operand5); if(operand5 < sum2){ printLine ("Gewinn oder Verlust: -"+(operand5 - sum2)); } if(operand5 > sum2){ printLine("Gewinn oder Verlust: +"+(operand5 - sum2)); } if(operand5 == sum2){ printLine("Gewinn oder Verlust: "+(operand5 - sum2)); } }
Im not an expert, and i dont know german, but from what i can tell you are trying to get the user to input a number and subtract the number from sever or whatever ... you could have :
i've never heard of readDouble() function in <iostream>Code:cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein:\n"; cin >> operand1; difference1 = (7 - operand1);
and also:
i've never heard of printLine, hoever maybe you got confused with the "printf" from CCode:printLine<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugenbrötchen ein:\n";
you can use 'cout'
i fixed it up for you:
Code:#include <iostream> using namespace std; int main() { double operand1; double operand2; double operand3; double operand4; double operand5; double difference1; double difference2; double difference3; double difference4; double sum1; double sum2; double sum3; double sum4; cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein:\n"; cin >> operand1; difference1 = (7 - operand1); cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugenbrötchen ein:\n"; cin >> operand2; difference2 = (5 - operand2); cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Käsestangen ein:\n"; cin >> operand3; difference3 = (5 - operand3); cout << "Geben Sie bitte der Anzahl der übrig gebliebene Laugencroissants ein:\n"; cin >> operand4; difference4 = (5 - operand4); sum1 = (difference1 + difference2 + difference3 + difference4); cout << "Geben Sie bitte Kassenstand am Ende in € ein:\n"; cin >> operand5; double product1 = (difference1 * 0.50); double product2 = (difference2 * 0.40); double product3 = (difference3 * 0.70); double product4 = (difference4 * 0.65); sum2 = (10 + product1 + product2 + product3 + product4); sum3 = (operand1 * 0.50 + operand2 * 0.40 + operand3 * 0.70 + operand4 * 0.65); sum4 = (7 * 0.50 + 5 * 0.40 + 5 * 0.70 + 5 * 0.65 + 10); cout << "Kassenstand wenn alles verkauft worden sein würde: " + sum4; cout << "So viel Geld müssen Sie in die Kasse haben: " + sum2; cout << "Preis der übrig gebliebene Waren: " + sum3; cout << "Aktuelle Kassenstand am Ende: " + operand5; if(operand5 < sum2){ cout << "Gewinn oder Verlust: -" + (operand5 - sum2); } if(operand5 > sum2){ cout << "Gewinn oder Verlust: +" + (operand5 - sum2); } if(operand5 == sum2){ cout << "Gewinn oder Verlust: " + (operand5 - sum2); } }
but here there is big problem.. you can not add a string to a number:
Code:cout << "Kassenstand wenn alles verkauft worden sein würde: " + sum4; cout << "So viel Geld müssen Sie in die Kasse haben: " + sum2; cout << "Preis der übrig gebliebene Waren: " + sum3; cout << "Aktuelle Kassenstand am Ende: " + operand5; if(operand5 < sum2){ cout << "Gewinn oder Verlust: -" + (operand5 - sum2); } if(operand5 > sum2){ cout << "Gewinn oder Verlust: +" + (operand5 - sum2); } if(operand5 == sum2){ cout << "Gewinn oder Verlust: " + (operand5 - sum2);
maybe you are trying to get a number input and then add the thing to the number.. or something..
EDIT:
you dont need 'double' since you are only working with whole numbers.. you might want to use 'int'
Last edited by mrafcho001; 03-20-2005 at 12:12 PM.
well i fixed some of my own . but can uy fix it right i get some errors i dont know how to fix when compiling.Code:#include <iostream> using namespace std; int main() { int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m; int n; int o; int p; int r; cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein: "); n = 7 - e; cin.ignore(); cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugenbrötchen ein: /n"); o = 5 - f; cin.ignore(); cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Käsestangen ein: /n"); p = 5 - g; cin.ignore(); cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugencroissants ein: /n"); r = 5 - h; cin.ignore(); j = n + o + p + r; cin.ignore(); cout<<"Geben Sie bitte Kassenstand am Ende in € ein: /n"); a = n * 0.50; b = o * 0.40; c = p * 0.70; d = r * 0.65; k = 10 + a + b + c + d; l = e * 0.50 + f * 0.40 + g * 0.70 + h * 0.65; m = 7 * 0.50 + 5 * 0.40 + 5 * 0.70 + 5 * 0.65 + 10; cout<<"Kassenstand wenn alles verkauft worden sein würde: " +m ; cout<<"So viel Geld müssen Sie in die Kasse haben: " +k ; cout<<"Preis der übrig gebliebene Waren: " +l ; cout<<"Aktuelle Kassenstand am Ende: " +i ; if( i < k ){ cout<<"Gewinn oder Verlust: -"+( i - k ; } if( i > k ){ cout<<"Gewinn oder Verlust: +"+( i - k ; } if( i == k ){ cout<<"Gewinn oder Verlust: "+( i - k ; } )
all i want is that this console application lets the user input a number and thats the number from right...i under lined it .
'cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein: ");
n = 7 - e;
cin.ignore();'
from there to the next code the user inputs a number
and the program displays fromto the bottom.Code:cout<<"Kassenstand wenn alles verkauft worden sein würde: " +m ;
i owe you.......thx for helping me out....u have no idea how thankfull i am
and the program needs to calculate all that and display result i want it to from cout<<"Kassenstand wenn alles verkauft worden sein würde: " +m ; to the bottom....thx again........ver very much!ure very kind