-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creation of a new cpp file to caonvert and test in the same file.
- Loading branch information
Asher Seiling
authored and
Asher Seiling
committed
Jun 1, 2020
1 parent
f53e124
commit e70c499
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
// MAIN | ||
int main(){ | ||
// Number it will add every loop | ||
double add_num_loop = .1; | ||
|
||
// What number it will go up to | ||
int run_up_to = 10; | ||
|
||
// Trys it counts up per try | ||
int trys_up = 1; | ||
|
||
|
||
// num its trying it on | ||
double num = 0; | ||
|
||
// amount of tries | ||
int try_num = 0; | ||
|
||
// True or false statement to see if it has been run enough | ||
bool try_tf = true; | ||
|
||
// Area works | ||
string area_works; | ||
|
||
// Circumference works | ||
string cir_works; | ||
// new pi equivalent | ||
double new_pi = .785; | ||
|
||
// old pi | ||
double old_pi = 3.14; | ||
|
||
// pi input | ||
double input_pi_old; | ||
|
||
// Would you like to test it input var | ||
string would_like_test; | ||
|
||
// pi new | ||
double pi_new; | ||
|
||
cout << "Enter a variation of PI" << endl; | ||
cin >> input_pi_old; | ||
double cal_convert = ((5 * 5)* old_pi) / 100; | ||
cout << "New variation of pi is: " + to_string(cal_convert) << endl; | ||
cout << "Would you like to test it?(Y/N)" << endl; | ||
cin >> would_like_test; | ||
if (would_like_test == "Y"){ | ||
} | ||
if(would_like_test == "N"){ | ||
cout << "Thankk you for converting." << endl; | ||
} | ||
else{ | ||
cout << "Syntax invalid, Please try again." << endl; | ||
yesorno; | ||
} | ||
|
||
pi_new = cal_convert; | ||
yesorno(); | ||
|
||
} | ||
|
||
|