Skip to content

Instantly share code, notes, and snippets.

@chaslbiv
Last active November 2, 2018 17:45
Show Gist options
  • Save chaslbiv/437c97a1b056ae6473995d9890d0243b to your computer and use it in GitHub Desktop.
Save chaslbiv/437c97a1b056ae6473995d9890d0243b to your computer and use it in GitHub Desktop.
Calculator created by chaslbiv - https://repl.it/@chaslbiv/Calculator
#include <iostream>
#include <string>
using namespace std;
//Please add equation/algorithm reccomendations. I will make them later
int main () {
int a;
cout<<"Which function would you like to perform:"<<endl;
cout<<"Reactionary Forces[1]"<<endl;
cin>>a;
switch (a) {
case 1:
cout<<"You have chosen Reactionary Forces"<<endl;
cout<<"For this, you will need the # of forces"<<endl;
int z;
cin>>z;
if (z == 1){
cout<<"What is the force?"<<endl;
float b;
cin>>b;
cout<<"Now, the distance of the force to the fulcrum:";
float c;
cout<<"\n";
cin>>c;
cout<<"Now, the distance from one side to the other:";
float d;
cin>>d;
float sum_1;
float sum_2;
sum_1 = c * b;
sum_2 = sum_1/d;
cout<<sum_2<<endl;
}
else if (z == 2){
cout<<"What is the force?"<<endl;
float b;
cin>>b;
cout<<"Now, the distance of the force to the fulcrum:";
float c;
cout<<"\n";
cin>>c;
cout<<"Now, what is force # 2?\n";
float e;
cin>>e;
cout<<"Now, what is the distance from force 2 to the fulcrum\n";
float f;
cin>>f;
cout<<"Now, the distance from one side to the other:";
float d;
cin>>d;
float sum_1;
float sum_2;
float sum_3;
sum_1 = c * b;
sum_2 = e * f;
sum_3 = (sum_1 + sum_2)/d;
cout<<sum_2<<endl;
}
break;
}
}
@chaslbiv
Copy link
Author

chaslbiv commented Nov 2, 2018

This is just an alpha version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment