473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

'endl' was not declared in this scope

1
Here is the code..
#include <iostream>
main()
{
double f_temp, k_temp, c_temp, temp;
char ch, quit;


std::cout << " *********** Temprature Conversion Calculator **************";
std::cout << "\n\n Please enter the temprature unit for which you want the coverison ";
std::cout << "\n 1. F for Fahrenheit to Celcius and Kalvin";
std::cout << "\n 2. C for Celsius to Fahrenheit and Kalvin";
std::cout << "\n 3. K for Kalvin to Fahrenheit and Celcius";
startagain:


std::cout << "\n\n Please enter you choice: ";
std::cin >> ch;

switch(ch)
{
case 'f':
case 'F':
std::cout << " Please enter temprature in Farhenheit: ";
std::cin >> f_temp;
c_temp = (f_temp - 32) * 5/9;
k_temp = (f_temp + 459.67) * 5/9;
std::cout << " Celcius =" << c_temp;
std::cout << "\n Kelvin =" << k_temp;
std::cout << "\n Do you want to calculate another value (y/n): ";
std::cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;

case 'c':
case 'C':
std::cout << " Please enter temprature in Celcius: ";
std::cin >> c_temp;
k_temp = c_temp + 273.15 ;
f_temp = c_temp * 9/5 + 32;
std::cout << " Kelvin =" << k_temp;
std::cout << "\n Farhenheit =" << f_temp;
std::cout << "\n Do you want to calculate another value (y/n): ";
std::cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;

case 'k':
case 'K':
std::cout << " Please enter temprature in Kelvin: ";
std::cin >> k_temp;
c_temp = k_temp - 273.15 ;
f_temp = (k_temp - 273.14) * 9/5 + 32;
std::cout << " Celcius =" << c_temp;
std::cout << "\n Farhenheit =" << f_temp;
std::cout << "\n Do you want to calcute another value (y/n): ";
std::cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;

default:
std::cout << "\n Invalid Choice";
}
std::cout << endl<<endl;
system("pause");
}
Nov 25 '13 #1
1 21164
I think std::endl it's a solution for that problem :)
Nov 25 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: William | last post by:
In Peer.h, I have: class Peer { // ... }; In Overseer.h, I have: #include "Peer.h" #include <vector>
3
by: Vaxius | last post by:
After trying to compile the following code, gcc gives me error: 'setwidth' was not declared in this scope I'm not sure why it would do this, since iomanip is included. Am I missing something?...
14
by: Darren L. Weber | last post by:
I am trying to compile a utility to create .avi files. See http://cpbotha.net/im2avi I'm working on Debian etch (a mix of testing/unstable). dweber@dnlweber:~/im2avi-0.4$ g++ --version g++...
4
by: Krice | last post by:
I get the following error: editarea.cpp: In member function `int Edit_Area::Mouse_Draw(int, int, unsigned char)': `g_undo' was not declared in this scope The problem is that g_undo is there....
9
by: Phrogz | last post by:
I'm trying to write an 'each' function for a JavaScript array that behaves like Ruby's Array#each. (It doesn't matter if you know Ruby to help with this question.) My problem is the scope of...
7
by: Frank | last post by:
Hi, I have the following problem with dynamic memory: int main(){ for(){ int (**w)=new int *; for(m = 0; m < N1; m++) {
2
by: Tim H | last post by:
help?!? #include <boost/shared_ptr.hpp> class pp_dirent {}; class pp_scope: public pp_dirent {}; int main() { boost::shared_ptr<pp_direntp1(new pp_scope()); boost::shared_ptr<pp_scopep2 =...
3
by: psroga | last post by:
Can anyone look at this code and let me know why pthread_mutex_unlock and pthread_mutex_lock are giving me the "phtread_mutex_unlock" was not defined in this scope error. I am compiling the code...
2
by: jr.freester | last post by:
I have a written a simple class called Matrix. It allows me to operate on a 2D array if it were a matrix. I have not really written a class in c++ since the single course I took in college. In...
2
by: ramyavictor | last post by:
#include <cstdio> #include <cstdlib> int main () { int i; printf ("Checking if processor is available..."); if (system(NULL)) puts ("Ok"); else exit (EXIT_FAILURE); printf...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.