#include <iostream>
using namespace std;
int main()
{
int keuze;
float i, u, r;
cout << "Wat wil je berekenen mbv de wet van Ohm?" << endl;
cout << "1: Spanning U" << endl;
cout << "2: Stroomsterkte I" << endl;
cout << "3: Weerstand R" << endl;
cin >> keuze;
switch(keuze)
{
case 1:
cout << "Geef I in (in A)" << endl;
cin >> i;
cout << "Geef R in (in Ohm)" << endl;
cin >> r;
u = r * i;
cout << "U = " << u << "V" << endl;
break;
case 2:
cout << "Geef U in (in V)" << endl;
cin >> u;
cout << "Geef R in (in Ohm)" << endl;
cin >> r;
i = u / r;
cout << "I = " << i << "A" << endl;
break;
case 3:
cout << "Geef U in (in V)" << endl;
cin >> u;
cout << "Geef I in (in A)" << endl;
cin >> i;
r = u / i;
cout << "R = " << r << " Ohm" << endl;
break;
default:
cout << "En wa verwacht ge nu da dees programmake doe? Koekskes bakke?" << endl;
}
cin.get();
cin.get();
return 0;
}