C++ grammar revised.



 Religions > Bible > C++ grammar revised.

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: Religions > Bible
User: "Simon"
Date: 29 Jan 2004 04:04:53 PM
Object: C++ grammar revised.
#include <iostream>
#include <string>
using namespace std;
string get_input();
string get_output();
void display_output();
int main()
{
string input, output;
input = get_input();
while (input != "QUIT")) {
output = get_output(input);
display_output(output);
input = get_input();
}
}
string get_input()
{
string input;
cout << "Enter word or \"QUIT\" to quit:" << endl;
getline(cin, input);
return input;
}
string get_output(const string &input)
{
string output;
if (input == "your") {
output = "Belonging to, or of, you.\n";
} else if (input == "you're") {
output = "Short for \"you are\".\n";
} else {
output = "Invalid input.\n";
}
return output;
}
void display_output(const string &output)
{
cout << output;
}
// Any suggestions are welcome!
//
// Credits:
// Andrew Rutherford
.

User: "Sonoman"

Title: Re: C++ grammar revised. 29 Jan 2004 10:31:49 PM
See coments next to code:
"Simon" <some_spare_id@yahoo.com> wrote in message
news:82ca3381.0401291404.34055371@posting.google.com...

#include <iostream>
#include <string>

using namespace std;

string get_input();
string get_output();
void display_output();

int main() //here you are telling the compiler that

main() will return an integer, where is it?

{
string input, output;

input = get_input();
while (input != "QUIT")) { // here you have one parenthesis too

many.

output = get_output(input); //in your function prototype your

declaration does not take a parameter.

display_output(output); //here is the same, you are passing

a parameter when you told your function

//it would not have

one. See more comments at the end.

input = get_input();
}
}

string get_input()
{
string input;

cout << "Enter word or \"QUIT\" to quit:" << endl;
getline(cin, input);

return input;
}

string get_output(const string &input)
{
string output;

if (input == "your") {
output = "Belonging to, or of, you.\n";
} else if (input == "you're") {
output = "Short for \"you are\".\n";
} else {
output = "Invalid input.\n";
}

return output;
}

void display_output(const string &output)
{
cout << output;
}

// Any suggestions are welcome!
//
// Credits:
// Andrew Rutherford

Go ***** yourself and post in the correct newsgroup. Well, sorry for that, it
seems that these harsh comments make you politically correct on this side of
cyberspace. Good luck.
.
User: "John Bailo"

Title: Re: C++ grammar revised. 29 Jan 2004 10:28:09 PM
Sonoman wrote:

See coments next to code:

"Simon" <some_spare_id@yahoo.com> wrote in message
news:82ca3381.0401291404.34055371@posting.google.com...

#include <iostream>
#include <string>

using namespace std;

string get_input();
string get_output();
void display_output();

int main() //here you are telling the compiler that


main() will return an integer, where is it?

{
string input, output;

input = get_input();
while (input != "QUIT")) { // here you have one parenthesis too


many.

output = get_output(input); //in your function prototype your


declaration does not take a parameter.

display_output(output); //here is the same, you are passing


a parameter when you told your function

//it would not have


one. See more comments at the end.

input = get_input();
}
}

string get_input()
{
string input;

cout << "Enter word or \"QUIT\" to quit:" << endl;
getline(cin, input);

return input;
}

string get_output(const string &input)
{
string output;

if (input == "your") {
output = "Belonging to, or of, you.\n";
} else if (input == "you're") {
output = "Short for \"you are\".\n";
} else {
output = "Invalid input.\n";
}

return output;
}

void display_output(const string &output)
{
cout << output;
}

// Any suggestions are welcome!
//
// Credits:
// Andrew Rutherford



Go ***** yourself and post in the correct newsgroup. Well, sorry for that, it
seems that these harsh comments make you politically correct on this side of
cyberspace. Good luck.


*****, nobody cares about you.
.

User: "Kadaitcha Man"

Title: Re: C++ grammar revised. 29 Jan 2004 11:52:59 PM
Sonoman wrote:

See coments next to code:

"Simon" <some_spare_id@yahoo.com> wrote:

#include <iostream>

//here you are telling the compiler that main() will
return an integer, where is it?
// here you have one parenthesis too many.
//in your function prototype your declaration does
not take a parameter.
//here is the same, you are passing a parameter when
you told your function

//it would not have one. See more comments at the end.

Simon is still in beta.
--
Your Free Insult: Thou sickening, acquiescing, impoverished mare irradiating boy band member.
.
User: "Sonoman"

Title: Re: C++ grammar revised. 30 Jan 2004 01:53:36 AM
Yep, he has a long way to go. Specially if he sticks to all the wrong
newsgroups. What the hell was he thinking? (
comp.os.linux.advocacy,alt.os.windows-xp,alt.bible,alt.language,alt.language
s.english
)
"Kadaitcha Man" <nospam@rainx.cjb.net> wrote in message
news:xgWFaey9ljfD77424DE4ZZZTKlYbd5ug@escortpartners.com...

Sonoman wrote:

See coments next to code:

"Simon" <some_spare_id@yahoo.com> wrote:


#include <iostream>


//here you are telling the compiler that main() will
return an integer, where is it?


// here you have one parenthesis too many.


//in your function prototype your declaration does
not take a parameter.


//here is the same, you are passing a parameter when
you told your function

//it would not have one. See more comments at the end.


Simon is still in beta.

--
Your Free Insult: Thou sickening, acquiescing, impoverished mare

irradiating boy band member.


.



User: "Lord Gazwad of Grantham"

Title: Re: C++ grammar revised. 29 Jan 2004 04:41:05 PM
Simon wrote:
|| #include <iostream>
|| #include <string>
||
|| using namespace std;
||
|| string get_input();
|| string get_output();
|| void display_output();
||
|| int main()
|| {
|| string input, output;
||
|| input = get_input();
|| while (input != "QUIT")) {
|| output = get_output(input);
|| display_output(output);
||
|| input = get_input();
|| }
|| }
||
|| string get_input()
|| {
|| string input;
||
|| cout << "Enter word or \"QUIT\" to quit:" << endl;
|| getline(cin, input);
||
|| return input;
|| }
||
|| string get_output(const string &input)
|| {
|| string output;
||
|| if (input == "your") {
|| output = "Belonging to, or of, you.\n";
|| } else if (input == "you're") {
|| output = "Short for \"you are\".\n";
|| } else {
|| output = "Invalid input.\n";
|| }
||
|| return output;
|| }
||
|| void display_output(const string &output)
|| {
|| cout << output;
|| }
||
|| // Any suggestions are welcome!
|| //
|| // Credits:
|| // Andrew Rutherford
Will you just *****, you dopey *****.
--
Gazwad
Freelance scientist and people tester.
Guardian: alt.os.windows-xp
Moderator: alt.warez.uk
.
User: "d2004xx"

Title: Re: C++ grammar revised. 30 Jan 2004 12:01:58 AM
"Lord Gazwad of Grantham" <yhbt@mail15.com> wrote in message news:<Fa9o3vGGJLaW23A87A8ESCQv9jlfinbw@dingo.net>...

Simon wrote:
|| #include <iostream>
|| #include <string>
||
|| using namespace std;
||
|| string get_input();
|| string get_output();
|| void display_output();
||
|| int main()
|| {
|| string input, output;
||
|| input = get_input();
|| while (input != "QUIT")) {
|| output = get_output(input);
|| display_output(output);
||
|| input = get_input();
|| }
|| }
||
|| string get_input()
|| {
|| string input;
||
|| cout << "Enter word or \"QUIT\" to quit:" << endl;
|| getline(cin, input);
||
|| return input;
|| }
||
|| string get_output(const string &input)
|| {
|| string output;
||
|| if (input == "your") {
|| output = "Belonging to, or of, you.\n";
|| } else if (input == "you're") {
|| output = "Short for \"you are\".\n";
|| } else {
|| output = "Invalid input.\n";
|| }
||
|| return output;
|| }
||
|| void display_output(const string &output)
|| {
|| cout << output;
|| }
||
|| // Any suggestions are welcome!
|| //
|| // Credits:
|| // Andrew Rutherford

Will you just *****, you dopey *****.

how can he *****??
.
User: "Gazwad"

Title: Re: C++ grammar revised. 30 Jan 2004 03:54:15 AM
d2004xx wrote:
|||
||| Will you just *****, you dopey *****.
||
|| how can he *****??
You still don't get it mate, do you?
--
Gazwad
Freelance scientist and people tester.
Guardian: alt.os.windows-xp
Moderator: alt.warez.uk
.




  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER