Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 10
There are 1 users currently browsing forums.
C and C++ Programming C and C++ are both robust and hugely popular programming languages that are used in multiple facets of programming, ranging from games to operating systems to simple text editors. To dicuss and seek advice, ask around here.

Reply
  #1  
Old 02-06-2010
Toddler
 
Join Date: Feb 2010
Posts: 8
Rep Power: 0
etereo is on a distinguished road
please help me with my home work :)

What is wrong with attempt at multiline comment in main()?

Code:
// dem01-1.cpp
// John C++. Molluzzo

#include <iostream>

using namespace std;

int main()
{ // This is the body of the
     function main()
cout << "This is our first C++ program." << endl;
cout << "It works!!!" << endl;

return 0;
}
What, if anything, is wrong with the following cout statement?

Code:
cout  >>  "My name is Maria; << endl
What, if anything, is wrong with the following program?

Code:
#include <iosteam      main(){     cout << "Is there something 
wrong " << endl << endl cout << "with this program"?;   }

have a nice day and god bless,

corey aka etereo
Reply With Quote
  #2  
Old 02-06-2010
Toddler
 
Join Date: Feb 2010
Posts: 7
Rep Power: 0
c++programmer is on a distinguished road
Re: please help me with my home work :)

You're using incorrect comments. // is for single line comments, such as...
Code:
// dem01-1.cpp
// John C++. Molluzzo

#include <iostream>

using namespace std;

int main()
{ //This is the body of the function main (MAKE SURE THIS IS ON ONLY ONE LINE!)
cout << "This is our first C++ program." << endl;
cout << "It works!!!" << endl;

return 0;
}
To do more than one line of comments, use this instead.
Code:
// dem01-1.cpp
// John C++. Molluzzo

#include <iostream>

using namespace std;

int main()
{ /* This is the body of the
    function main()*/
cout << "This is our first C++ program." << endl;
cout << "It works!!!" << endl;

return 0;
}
The problem with your code is that your cout arrows should be pointing <<, and cin statements should be pointing >>. Also, only put the semicolon at the end of the line, not at the end of what you're couting. Also, you forgot the end quote on "my name is maria". Your code should look like this:
Code:
cout << "My name is Maria" << endl;
I'm sorry, but I refuse to tell you what's wrong with your code. Please reference this page for information on how to start your program. (I'll hint: it's pretty much all wrong).
Reply With Quote
  #3  
Old 4 Weeks Ago
Toddler
 
Join Date: Feb 2010
Posts: 8
Rep Power: 0
etereo is on a distinguished road
Re: please help me with my home work :)

i really need help with the other two questions if anyone will help, i will be very grateful
Reply With Quote
  #4  
Old 4 Weeks Ago
Moderator
 
Join Date: Dec 2005
Posts: 1,862
Rep Power: 6
Umang is on a distinguished road
Re: please help me with my home work :)

You should thank him, you know...

Also, I believe c++programmer has already explained the theory behind what's wrong with the remaining pieces of code. You should not expect us to feed you the answer. Solve the last one yourself, he's told you how to.
Reply With Quote
  #5  
Old 4 Weeks Ago
Toddler
 
Join Date: Feb 2010
Posts: 7
Rep Power: 0
c++programmer is on a distinguished road
Re: please help me with my home work :)

If it turns out this thread is one big joke by the poster, oh well, at least I tried. Here's what your code looks like:
Code:
#include <iosteam      main(){     cout << "Is there something [ 
wrong " << endl << endl cout << "with this program"?;   }
This is what your code SHOULD look like:
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Is there something wrong with this program?" << endl;

return 0;

}
In fact...why don't you just go ahead and come out and tell us your thread is a joke. Because there's no way someone can have that many problems with their code.
Reply With Quote
  #6  
Old 4 Weeks Ago
Moderator
 
Join Date: Dec 2005
Posts: 1,862
Rep Power: 6
Umang is on a distinguished road
Re: please help me with my home work :)

No. I think these are questions from a textbook that etereo has to answer for homework.

Quote:
Youngcoders Posting Guidelines originally posted:
  1. Do not ask for homework answers, nor post answers. We are glad to walk you through the process, but please understand that it must be your own thinking - that is the point of learning.
Computer Programmers, Programming Forum | Young Coders - FAQ: Guidelines
Reply With Quote
  #7  
Old 4 Weeks Ago
Toddler
 
Join Date: Feb 2010
Posts: 7
Rep Power: 0
c++programmer is on a distinguished road
Re: please help me with my home work :)

Oh, sorry. Hope I didn't break any rules, didn't know it was for his homework.
Reply With Quote
  #8  
Old 4 Weeks Ago
Moderator
 
Join Date: Dec 2005
Posts: 1,862
Rep Power: 6
Umang is on a distinguished road
Re: please help me with my home work :)

You needn't apologize. You were genuinely helping.
Reply With Quote
  #9  
Old 3 Weeks Ago
Toddler
 
Join Date: Feb 2010
Posts: 8
Rep Power: 0
etereo is on a distinguished road
Re: please help me with my home work :)

thanks for all the help everyone
Reply With Quote
  #10  
Old 3 Weeks Ago
New Born
 
Join Date: Feb 2010
Posts: 4
Rep Power: 0
Zoomskij is on a distinguished road
Re: please help me with my home work :)

>> - It is used at use of the operator cin.
Code:
 
char MyString[100];
cin >> MyString;
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thriller - the Perfect Work of Michael Jackson janej363 Chit Chat and Hangout 1 06-28-2009 04:39 PM
7 Ways to Make Your Code Work with PHP6 Mau PHP Articles 10 09-16-2007 09:42 AM
Question about Home Severs Vista06 Computer Corner 1 02-06-2007 04:15 AM
Getting Mouse Wheel and Side Buttons to Work in X.org/XFree _jameshales Articles, Tutorials, and Guides 0 01-01-2006 09:23 PM