C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 12th, 2004, 07:21 PM
Byoon Byoon is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 Byoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Rock Weight Error

I am having trouble fixing the problems in this porgram. Thanks for any help anyone can provide.

#include <iostream>

int main()
{
float caratWt, // Weight of stone in carats
millWt, // Weight of stone in milligrams
gramWt, // weight of stone in grams
ounceWt; // Weight of stone in ounces

// Prompt the user for the weight of a precious stone in carats.
cout << endl; //endl will cause a line return on the monitor
cout << "Enter a precious stone's weight (in carats) "
cin>>caratWt;

// Convert from carats to milligrams.e number of milligrams?
millWt = caratWt * 200;
cout << "This stone weighs " << millWt << " milligrams." << endl;

// Convert from milligrams to grams.
gramWt = millWt * 1000;
cout << "This stone weighs " << gramWt << " grams." << endl;

// Convert from grams to ounces.
ounceWt = gramWt / 28.35;
cout << "This stone weighs " << ounceWt << " ounces." << endl;
}


.................................................. ...

Test 03.cpp: In function `int main()':
Test 03.cpp:11: error: `cout' undeclared (first use this function)
Test 03.cpp:11: error: (Each undeclared identifier is reported only once for
each function it appears in.)
Test 03.cpp:11: error: `endl' undeclared (first use this function)
Test 03.cpp:13: error: syntax error before `>>' token

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Rock Weight Error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT