Moin Leute, hab ihr mal die Switch Funktion kopiert welche noch unvollständig ist da ich es im Unterricht nicht geschafft habe diese fertig zu bekommen. Falls Jemand Lust und Zeit hat, kann er die ja vervollständigen.
//Michael Kullik; AuswahlfunktionOhmsches; menue; 25.01.11;
#include <iostream.h>
#include <conio.h>
float fspannung, fstrom, fwiderstand;
int iwahl;
void main()
{
anfang:
clrscr();
gotoxy(5,3);cout<<"Flaechenberechnung";
gotoxy(5,4);cout<<"==================";
gotoxy(5,5);cout<<"1. Spannungsberechnung";
gotoxy(5,6);cout<<"======================";
gotoxy(5,7);cout<<"2. Widerstandsberechnung";
gotoxy(5,
;cout<<"========================";
gotoxy(5,9);cout<<"3. Stromstärkenberechnung";
gotoxy(5,10);cout<<"========================";
gotoxy(5,11);cout<<"4. Programmende";
gotoxy(5,12);cout<<"===============";
gotoxy(5,14);cout<<"Waehlen Sie aus (1 bis 4 ): ";
cin>>cwahl;
switch (cwahl)
{
case'1': fspannung; break;
case'2': fwiderstand ; break;
case'3': fstrom ; break;
case'4': goto ende;
};
goto anfang;
ende:
}
float fspannung;
{
clrscr();
gotoxy(5,5);cout<<"Spannungsberechnung";
getch();
}
float fstrom;
{
clrscr();
gotoxy(5,5);cout<<"Widerstandsberechnung";
getch();
}
float fwiderstand;
{
clrscr();
gotoxy(5,5);cout<<"Stromstärkenberechnung";
getch();
}