Lame request for help

This is a discussion on Lame request for help within the C++ Programming forums, part of the General Programming Boards category; Okay...okay...I know this is pathetic, but I don't have any other options right now. I have to turn in an ...

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    4

    Lame request for help

    Okay...okay...I know this is pathetic, but I don't have any other options right now. I have to turn in an assignment onlie tonight for a class but I don't have access to a computer with a compiler or to a computer that can run Visual C++. I had to write this in Notepad of all things. Anyways, I need somebody to compile this or give it a quick glance and tell me. Sorry in advance for being a wanker:

    Code:
    #include <iostream>
    std::cout;
    std::endl;
    
    //Declarations
    int purchasePrice  = 28000;
    int depAmt         =  4000;
    int endOfYearValue =     0;
    int totalDep       =     0;
    int year	   =     0;
    
    /*
    	Main Function
    	
    	Pre-Conditions :	None.
    	Post-Conditions:	Output of a depreciation chart displayed to 
    				the screen.
    */
    
    
    int main ();
    
    {
    	//Output header display
    	cout << "                          END-OF-YEAR      ACCUMULATED" << endl
    	     << "YEAR     DEPRECIATION       VALUE         DEPRECIATION" << endl
                 << "----     ------------     -----------     ------------" << endl;
    
    	while (totalDep < purchasePrice)
    	{
    		//Calculations
    		year++;
    		endOfYearValue = purchasePrice - (depAmt * year);
    		totalDep += depAmt;
    
    		//Calcualtion display
    		cout << " " << year << "           " << depAmt << "          " << endOfYearValue <<
    		     "            " << totalDep << endl;
    	}	
    
    } //End Main

  2. #2
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244
    1) You must remove the ; after main()
    2) You must use the word "using" in front of std::cout before the main
    using std::cout
    or you can just replace all of them for using namespace std
    3) Download a compiler, it have 6 mb at maximum: http://www.bloodshed.net/dev/devcpp.html
    Nothing more to tell about me...
    Happy day =)

  3. #3
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,161

    Re: Lame request for help

    Originally posted by Guyver03
    ... I don't have access to a computer with a compiler ...
    Many free compilers abound. I know Borland 5.5 is available free and I believe it does not require installation into the registy. So you can download, compile, and delete if you don't want the compiler to hang around.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  4. #4
    Registered User
    Join Date
    Dec 2003
    Posts
    4

    Re: Re: Lame request for help

    Originally posted by WaltP
    Many free compilers abound. I know Borland 5.5 is available free and I believe it does not require installation into the registy. So you can download, compile, and delete if you don't want the compiler to hang around.
    It's not that I don't have a compiler to install, it's that the only computer I have complete fulltime access to is not my mine, slow, outdated, and so full of parasites and viruses that it's sickening.

    I know...it's pathetic that I'm a programming student and I don't have a computer but I'm doing what I can! Actually, I'm letting a friend move in basically because he has a nice machine I can leach off of :P !

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with client GET request path
    By NuNn in forum C Programming
    Replies: 1
    Last Post: 02-25-2009, 03:34 PM
  2. Can you check what is wrong with this code
    By Ron in forum C++ Programming
    Replies: 4
    Last Post: 08-01-2008, 11:59 PM
  3. my HTTP request handler code correct?
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-25-2008, 05:01 AM
  4. denied request
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 09-21-2001, 12:35 AM

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