|
-
Jul 15th, 2001, 07:45 AM
#1
Thread Starter
Fanatic Member
Calculator using IOSTREAM
Code:
#include <iostream>
#include <string>
using namespace std;
string thename;
float thenum;
float thenum2;
float thenum3;
void addfunc(float a, float b,float c);
int main()
{
cout<<"Welcome to the math world!!!\n\n\n\n"<<endl;
addfunc(thenum,thenum2,thenum3);
cout<<"\n\n\n\n*************HTTP://WWW.MERLINPAL.COM************\n\n"<<endl;
return 0;
}
void addfunc(float a, float b,float c)
{
cout<<"Number1\n"<<endl;
cin>>thenum;
cout<<"Number2\n"<<endl;
cin>>thenum2;
cout<<"Number3\n"<<endl;
cin>>thenum3;
a=thenum;
b=thenum2;
c=thenum3;
int thewhole=a+b+c;
cout<<"\n\n\nToltal: "<<thewhole<<endl;
}

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jul 15th, 2001, 08:23 AM
#2
Frenzied Member
So is there a problem or ...
-
Jul 15th, 2001, 08:32 AM
#3
Thread Starter
Fanatic Member
Writing Win32 APP.
Hi, I'm an expert in VB, but I think I should move on to VC++ Win32 App.
Can you send me an example that will Create a simple window(dialog)?
Thanks a lot.

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jul 15th, 2001, 10:23 AM
#4
PowerPoster
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Jul 15th, 2001, 10:41 AM
#5
Frenzied Member
Parksie has a nice one...might be
http://www.parksie.net/raw.zip
I think that's it.
whats wrong with your calculator?
-
Jul 15th, 2001, 01:54 PM
#6
Frenzied Member
-
Jul 15th, 2001, 02:07 PM
#7
Frenzied Member
Thats it! But I could never get it to work because my VC++ can't view English (UK) for some reason, only English (USA) you know how to fix that?
-
Jul 15th, 2001, 06:36 PM
#8
Thread Starter
Fanatic Member
Parksie Doesn't work:(
Parksie.net doesn't work...
People can you guys look at this piece of code? It opens "d:\yuck.txt" to write in the string "username". But it doesn't work... Also when I enter the age, the email input is already doned....I mean please try this out and help me... I know you people are experts
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
char username[200];
int userage;
char useremail[100];
char userwebsite[100];
char usersay[1000];
void SEE_AGE();
int main()
{
cout<<"HELLO, PLEASE TELL ME WHAT'S YOUR NAME:\n\n";
cin.getline(username,200);
cout<<"\n\nOK, "<<username<<". Please tell me how old are you?\n\n";
cin>>userage;
if(userage>40){
cout<<"\n\nYou are an old man, "<<username<<"!\n";
}
else if(userage<10){
cout<<"\n\nWow, you are so young, "<<username<<"!\n";
}
else if (userage>80){
cout<<"\n\nAren't you a old folk? "<<username<<"!\n";
}
else{
cout<<"\n\nCool, you're "<<userage<<", "<<username<<"?\n";
}
cout<<"\n\n"<<username<<", your e-mail address?\n\n";
cin.getline (useremail,100);
cout<<"\n\n"<<username<<", what's your URL?\n\n";
cin.getline (userwebsite,100);
cout<<"\n\n"<<"Comments?\n\n";
cin.getline (usersay,1000);
ofstream the_FILE("d:\yuck.txt");
if (!the_FILE.is_open()){
the_FILE<<"User Info:\n";
the_FILE<<username<< "\n\n";
the_FILE.close();
}
return 0;
}
void SEE_AGE()
{
if(userage>40){
cout<<"You are an old man, "<<username<<"!\n";
}
else if(userage<10){
cout<<"Wow, you are so young, "<<username<<"!\n";
}
else if (userage>80){
cout<<"Aren't you a old folk? "<<username<<"!\n";
}
else{
cout<<"Cool, you're "<<userage<<", "<<username<<"?\n";
}
}

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jul 16th, 2001, 02:34 AM
#9
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|