I just started to study informatics. Now i got my first task and i,am full of questions. Does someone have some advice for me? The task is to create an math formula which allows to decide between 3 different formula without any kind of "switch, if-else or other operators" Sooo goal is it to just cin a number; decide with cin 1, 2 or 3 between Celsius to Fahrenheit, meters in foot or € in $ and gettin a result. Im pretty new and just asking me for like 2 hours what such a formula would look like D: any idea?
My Actual Code looks like this. (we arent allowed to use any kind of code we hadnt in our lectures yet. Allowed are just: value assignment, variables, simply data types , basic calculus, cins and couts..
Im just curious on that formula which does not get into my head and how to code it...
#include <iostream>
using namespace std;
int main()
{
double eingabe;
int auswahl = 0;
double ergebnis;
//zahleneingabe
cout << "Ihre Eingabe: ? " << endl;
cin >> eingabe;
cout << "Ihre Eingabe: " << eingabe << endl;
system("PAUSE");
//abfragenausgabe der umrechnungsart
cout << "Ihre Auswahl der Umwandlung: " << endl;
cout << "1 - Celsius in Fahrenheit" << endl;
cout << "2 - Meter in Fuss" << endl;
cout << "3 - Euro in US Dollar " << endl;
cin >> auswahl;
cout << "Ihr Ergebnis ist: " << ergebnis << endl;
system("PAUSE");
}