Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class AnyString {
private String str;
// Two constructors for string method intialized to accept strings and character array
public AnyString(String str) {
this.str = str;
import java.util.Scanner;
class AnyStringz {
String input = "";
public AnyStringz(String b){
//reassign input to b
this.input = b;
@scwilso
scwilso / program.java
Last active September 14, 2016 21:24
public class CalculatePI {
public static void main(String [] args){
// 1. piSum is the variable to contain the PI calculation
double piSum = 0.0;
double piNumer = 1.0;
double piDenom = 1.0;
double mathPi = Math.PI;
// 2. n will count the iterations
public class CalculatePI {
public static void main(String [] args){
// 1. piSum is the variable to contain the PI calculation
double piSum = 0.0;
double piNumer = 1.0;
double piDenom = 1.0;
double mathPi = Math.PI;
// 2. n will count the iterations
public class CalculatePI {
public static void main(String [] args){
// 1. piSum is the variable to contain the PI calculation
double piSum = 0.0;
double piNumer = 1.0;
double piDenom = 1.0;
double mathPi = Math.PI;
// 2. n will count the iterations
public class CalculatePI {
public static void main(String [] args){
// 1. piSum is the variable to contain the PI calculation
double piSum = 0.0;
double piNumer = 1.0;
double piDenom = 1.0;
double mathPi = Math.PI;
// 2. n will count the iterations
@scwilso
scwilso / gist:46aef91563d08962f5bf8e7116d9b15c
Created September 14, 2016 18:33
PI to ten million with for and when loops
/////////////////////////
//
// Name:
// Class:
// Project: Assignment 4
// Date: 9/13/2016
//
////////////////////////
public class CalculatePI {