- #1
rollcast
- 408
- 0
Code:
#include <iostream>
using namespace std;
int main()
{
cout<< "Roll Cast's Celsius to Fahrenheit Converter\n Please enter the minimum temperature in celsius\n";
double min;
cin>> min;
jump:
cout<< "Please enter the maximum temperature in celsius\n";
double max;
cin>> max;
cout<< "Please enter the number of steps for the temperature range, non zero integer\n";
int steps;
cin>> steps;
if (min > max);
{cout<< "Your values for max. and min. temperature are impossible please re-enter them.\n";
goto jump;
}
cout<<"Press ENTER to continue\n";
cin.get();
cin.ignore();
return 0;
}
I found a problem on another website to make a temperature converter, http://www.cprogramming.com/challenges/celsius_converter_table.html .
This is the code I have written so far, I haven't looked at the correct solution yet, this basically collects the users inputs and makes sure they are possible, ie. min < max. However when it gets to the goto and it re asks for the min and max it doesn't ask for the no. of steps and just goes into a loop by asking for the 2 inputs over and over.