table value

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 101
Reputation: Se7Olutionyg has a little shameless behaviour in the past 
Solved Threads: 0
Se7Olutionyg Se7Olutionyg is offline Offline
Junior Poster

table value

 
0
  #1
Oct 17th, 2008
  1. // file temperature table.cpp
  2. //conversion of celsius to fahrenheit temperature
  3.  
  4. # include <iostream>
  5. # include <inomanip>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. const int CBEGIN = 10;
  12. const int CLIMIT = -5;
  13. const int CSTEP = 5;
  14. float fahrenheit;
  15.  
  16. cout << " Celsius " << " Fahrenheit " << endl;
  17.  
  18. //display the table
  19. for (int celsius = CBEGIN;
  20. celsius >= CLIMIT;
  21. celsius -= CSTEP)
  22.  
  23. {
  24. fahrenheit = 1.8 * celsius + 32.0;
  25. cout << setw(5) << celsius
  26. << setw(15) << fahrenheit << endl;
  27. }
  28. return 0;
  29. }

thhe program ssaid that the setw(5) is undeclared
can u correct for me and explain more for me the function of setw in the simple way
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: table value

 
0
  #2
Oct 17th, 2008
>> include <inomanip>
That file doesn't exist either. It's misspelled.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 114
Reputation: sidatra79 is an unknown quantity at this point 
Solved Threads: 8
sidatra79's Avatar
sidatra79 sidatra79 is offline Offline
Junior Poster

Re: table value

 
0
  #3
Oct 17th, 2008
exactly the correct is:
#include <iomanip>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC