C++ Homework Help!!!!

This is a discussion on C++ Homework Help!!!! within the C++ Programming forums, part of the General Programming Boards category; Im Dumb!!!!!...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    16

    C++ Homework Help!!!!

    Im Dumb!!!!!
    Last edited by bar5037; 10-01-2007 at 12:49 PM.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    Homework Policy.

    Seriously... nobody here cares if you fail this assignment.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    16
    ill try this again when i actually have a specific problem
    Last edited by bar5037; 10-01-2007 at 12:50 PM.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,456
    We could, but it appears that you have not even attempted it yourself.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    I have a signature here for events like this.

  6. #6
    Registered User
    Join Date
    Oct 2007
    Posts
    16
    Im Dumb Still
    Last edited by bar5037; 10-01-2007 at 12:49 PM.

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Of course if you'd shown up a week ago (or whenever you got the assignment) then we could have helped you.

    But showing up in a panic with a few hours to go with the "hail mary" pass into the end zone hoping to get lucky is just that, a hope.

    How about starting at the beginning, can you write the code just to input your polygon data. In other words, what's the first step which is causing you problems, so we know at about what level to pitch the answers at.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Registered User
    Join Date
    Oct 2007
    Posts
    16
    salem your a good man... ok so heres what i have
    #include <iostream>
    #include <fstream>
    using namespace std;

    int main();
    {
    ifstream infile;

    //open a file
    infile.open("polytest.txt")
    while (infile.eof());
    cout << "enter number of vertices" <<endl;
    cin >> Pvert;

  9. #9
    Registered User
    Join Date
    Oct 2007
    Posts
    16
    now i wanted to see if that part was working, however when i tried to output the values a fatal error occured at the open brace.

  10. #10
    Registered User
    Join Date
    Oct 2007
    Posts
    16
    1>c:\homeworkfiles.cpp\polygon\polygon\polygoncode .cpp(16) : fatal error C1075: end of file found before the left brace '{' at 'c:\homeworkfiles.cpp\polygon\polygon\polygoncode. cpp(6)' was matched
    this is the specific error that came up. like i siad im new to this and im not an IST major.... i really apprecaite the help though.

  11. #11
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    Try to use [CODE][/CODE] tags when you post code. There are a few mistakes in what you posted... aside from the obvious fact that you never finish main, your while loop will never complete with that semicolon at the end of it and really you shouldn't be controlling a loop with the eof() method. However, maybe I misread your original assignment before you removed it, but I do believe it was significantly more advanced than what you just attempted.
    Code:
    while(true);  // That semicolon represents the end of the looping body, which means if the body 
                  // (which in this and your case is non-existant) never makes the condition false, 
                  // then the loop is infinite.
    
    /* A loop should properly be like this
    while(::condition::) {
       ::body of loop::  // Something here should affect the condition assuming it doesn't affect itself
    };
    */
    Last edited by SlyMaelstrom; 10-01-2007 at 01:19 PM.
    Sent from my iPadŽ

  12. #12
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > int main();
    No ; here.

    You seem to be missing a closing brace as well.

    Also, please use the [code][/code] tags around the code when you post it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  13. #13
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    Quote Originally Posted by Salem View Post
    > int main();
    No ; here.

    You seem to be missing a closing brace as well.

    Also, please use the [code][/code] tags around the code when you post it.
    ...and I'm blind. And I shouldn't be searching this site at work, anyway... 'scuse me, gents... I got work to do.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 11-03-2001, 03:39 PM
  2. Homework
    By kermi3 in forum C++ Programming
    Replies: 15
    Last Post: 09-26-2001, 03:16 PM
  3. Homework
    By kermi3 in forum Windows Programming
    Replies: 5
    Last Post: 09-15-2001, 11:48 AM
  4. Homework
    By kermi3 in forum C Programming
    Replies: 0
    Last Post: 09-10-2001, 01:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21