[컴퓨터공학]C++을 이용하여 섭씨화씨로 변환
- 등록일 / 수정일
- 페이지 / 형식
- 자료평가
- 구매가격
- 2006.04.27 / 2019.12.24
- 1페이지 / (기타파일)
- 평가한 분이 없습니다. (구매금액의 3%지급)
- 500원
최대 20페이지까지 미리보기 서비스를 제공합니다.
자료평가하면 구매금액의 3%지급!
1
2
추천 연관자료
- 하고 싶은 말
-
C++을 이용하여 섭씨에서 화씨로, 화씨에서 섭씨로 변환 하였습니다.
- 본문내용
-
#include<iostream>
#include<iomanip>
using std::ios;
using std::cout;
using std::cin;
using std::endl;
using std::setprecision;
using std::setiosflags;
void change_ctof(double a);
void change_ftoc(double b);
void change_ctof(double a)
{
double temp1;
temp1 = (9.00 / 5.00) * a + 32.00;
cout << setprecision (2)<< setiosflags( ios::fixed | ios::showpoint ) << a
<< " --> "
<<setprecision (2)<< setiosflags( ios::fixed | ios::showpoint ) << temp1 << endl;
}
void change_ftoc(double b)
{
double temp2;
temp2 = (b - 32.00) * (5.00 / 9.00);
cout << setprecision (2)<< setiosflags( ios::fixed | ios::showpoint ) << b
<< " --> "
<<setprecision (2)<< setiosflags( ios::fixed | ios::showpoint ) << temp2 << endl;
}
int main()
{
int choice, loop;
double in1, in2;
for(loop=1 ; loop<=5 ; ++loop)
{
cout << endl;
cout << endl;
cout << "========== Menu ==========\n";
cout << "0. Program END\n";
cout << "1. celsius -> fahrenheit\n";
cout << "2. fahrenheit -> celsius\n";
cout << "==========================\n\n";
cout << "choice the number: ";
cin >> choice;
cout << endl;
if(choice==0)
break;
자료평가
-
아직 평가한 내용이 없습니다.