Welcome to Dream.In.Code
Become a C++ Expert!

Join 136,907 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,764 people online right now. Registration is fast and FREE... Join Now!




C++

 
Reply to this topicStart new topic

C++

slimdime
15 Mar, 2008 - 07:13 PM
Post #1

New D.I.C Head
*

Joined: 15 Mar, 2008
Posts: 22

I'm getting an error on this, can someone tell me what the error is?




// Program Schedule prints a daily schedule with the

// amount of time spent on each task.

#include <iostream.h>

const int DRESS = 45;

const int EAT = 30;

const int DRIVE = 30;

const int CLASS = 60;

int main()

{

int totalMinutes;

totalMinutes = DRESS + 3*EAT + 2*DRIVE + 4*CLASS;

cout << "You spend " << totalMinutes / 60

<< " hours and " << totalMinutes % 60

<< " minutes a day on scheduled activities."

<< endl;

return 0;

}

User is offlineProfile CardPM
+Quote Post

aj32
RE: C++
15 Mar, 2008 - 07:25 PM
Post #2

D.I.C Addict
Group Icon

Joined: 30 Aug, 2007
Posts: 577



Thanked: 2 times
Dream Kudos: 675
My Contributions
I am able to compile you program fine, is your problem that you can't add system("pause");? If it is, you need to include cstdlib before you include iostream. Also, you need to add
CODE
using namespace std;
just after #include <iostream.h>.

Also, for future reference, please code.gif!

Hope this helps, if you still have problems with it, please post the exact error!

-Aj32 smile.gif

This post has been edited by aj32: 15 Mar, 2008 - 07:26 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/3/08 09:51PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month