Skip to content

Commit

Permalink
Finishing of old pi to new pi C++ and java files
Browse files Browse the repository at this point in the history
  • Loading branch information
AsherSeiling committed May 27, 2020
1 parent 0194134 commit 924d1da
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

.DS_Store
.vscode/settings.json
24 changes: 24 additions & 0 deletions Convert different pi numbers to new pi/Old_pi_to_new_pi.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
#include <iostream>

using namespace std;

int main(){
// Number used as diameter
double diamiter = 10;

// Radius variable
double radius = diamiter / 2;

// Stating of input request
cout << "input variation of pi you wand to preform the calculation on:" << endl;

// Input var deceleration
double pi;

// Input usage
cin >> pi;

// Calculation
double cal1 = ((radius * radius)* pi) / 100;

// Display result
cout << "The new pi is: " + to_string(cal1) << endl;
cout << "Thank you for using Seiling old pi to new pi converter." << endl;


}
14 changes: 12 additions & 2 deletions Convert different pi numbers to new pi/Old_pi_to_new_pi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

public class Old_pi_to_new_pi{
public static void main(final String[] args) {
// Number used as diamiter
final Double diamiter = 10.0;
// Radius number
final Double radius = diamiter/2;
// Scanner Decleration
Scanner input = new Scanner(System.in);
final Scanner input = new Scanner(System.in);

// First displayed line
System.out.println("Input the variarion of pi you want to convert to new pi");
// Input under the line
Double pi_num_var = input.nextDouble();
final Double pi_num_var = input.nextDouble();
// Calculation
final Double calculation1 = ((radius * radius) * pi_num_var) / 100;
// Display Result
System.out.println("New pi is: " + calculation1);
System.out.println("Thank you for using Seiling Old to new pi converter");


}
}

0 comments on commit 924d1da

Please sign in to comment.