Skip to content

Instantly share code, notes, and snippets.

Created June 27, 2012 02:30
Show Gist options
  • Save anonymous/3000955 to your computer and use it in GitHub Desktop.
Save anonymous/3000955 to your computer and use it in GitHub Desktop.
Calculater switch statement
#include "AirAndVolume.h"
#include <iostream>
using namespace std;
AirAndVolume::AirAndVolume()
{
float CubeLO,CubeLA,CubeHA,CubeVolume,CubeAL,CubeAT,CubePDB,CubeADLB;
string CubeExit;
CubeStart:
cout<<"Stats de un Rectangle ou cube\n "<<endl;
cout<<" _________________________\n / _____________________ /|\n / / ___________________/ / |\n / / /| | / / |\n / / / | | / / . |\n / / /| | | / / /| |\n / / / | | | / / / | |\n / / / | | | / / /| | |\n / /_/__________________/ / / | | |\n/________________________/ / | | |\n| ______________________ | | | | |\n| | | | | |_________| | |__| | |\n| | | | |___________| | |____| |\n| | | / / ___________| | |_ / /\n| | | / / / | | |/ / /\n| | | / / / | | | / /\n| | |/ / / | | |/ /\n| | | / / | | ' /\n| | |/_/_______________| | /\n| |____________________| | /\n|________________________|/\n";
cout<<"Quelle est la Longeur de votre Rectangle?\n:";
cin>>CubeLO;
cout<<"Quelle est la Largeur de votre Rectangle?\n";
cin>>CubeLA;
cout<<"Quelle est la Hauteur de votre Rectangle?\n";
cin>>CubeHA;
CubeADLB = CubeLO * CubeLA;
CubePDB = (CubeHA*2)+(CubeLA*2)+(CubeLO*2);
CubeAL = CubePDB*CubeHA;
CubeAT = CubeAL+2*CubeADLB;
CubeVolume = CubeADLB*CubeHA;
cout<<"\nVolume ------------------- " <<CubeVolume<<"\nAir Laterale ------------- "<<CubeAL<<"\nAir Totale --------------- "<<CubeAT<<"\nAire De La Base ---------- "<<CubeADLB<<"\nPreimetre de la base ----- "<<CubePDB<<endl;
cout<<"\n\nVous voulez calculer de nouveau?";
cin>> CubeExit;
if(CubeExit == "oui"){
goto CubeStart;
}else{
}
}
int test()
{
cout<<"testfonction";
}
#ifndef AIRANDVOLUME_H
#define AIRANDVOLUME_H
class AirAndVolume
{
public:
AirAndVolume();
};
#endif // AIRANDVOLUME_H
#include <iostream>
#include "AirAndVolume.h"
using namespace std;
int main()
{
int MAINChois;
MAINStart:
cout<<" ----- CalculatorV -----"<<endl;
cout<<"\n\n\n";
cout<<" ~Volumes et Aires~\n\n1) Cube/Rectangle 2) Triangle\n3) Cylindre 4) Pyramide\n5) Cone 6) Sphere / Demi Sphere\n\n";
cout<<"Select a option with the number of the option :";
cin>>MAINChois;
switch(MAINChois){
case 1:{
AirAndVolume Cube;
break;
}
case 2:{
test a;
}
default:
cout<<"unknow option."
goto MAINStart;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment