Skip to content

Instantly share code, notes, and snippets.

@jpotts18
Created July 21, 2014 05:41
Show Gist options
  • Save jpotts18/0d7ab9e1150f49c47f0b to your computer and use it in GitHub Desktop.
Save jpotts18/0d7ab9e1150f49c47f0b to your computer and use it in GitHub Desktop.
Jonathan's Scrambler
package io.jpotts18.algoritms;
import java.util.ArrayList;
import java.util.List;
public class JonStuff {
public static void main(String[] args){
User jon = new User("Jonathan", "Potter");
System.out.println(jon.getFullName());
User jeff = new User("Jeff", "Potter");
System.out.println(jon);
System.out.println(jeff);
List<Workout> workoutList = new ArrayList<Workout>();
Workout jeffsWorkout = new Workout("Jeff's Killer Workout", 60);
Workout jonsWorkout = new Workout("Jon's Killer Workout", 45);
Workout buns = new Workout("Buns and thighs Workout", 30);
workoutList.add(jeffsWorkout);
workoutList.add(jonsWorkout);
workoutList.add(buns);
// sort by workout (minutes) & (body part) & (intensity) & (exercise type - compound, iso)
}
}
package io.jpotts18.algoritms;
/**
* Created by jpotts18 on 7/20/14.
*/
public class Exercise {
private String name; // pull ups
private int reps; // 10 reps
private int sets; // 2 sets
private ExceciseType exceciseType;
public Exercise(String name, int reps, int sets){
this.name = name;
this.reps = reps;
this.sets = sets;
}
}
package io.jpotts18.algoritms;
import java.util.UUID;
public class User {
String BEGINNER = "beginner";
String INTERMEDIATE = "intermediate";
String ADVANCED = "advanced";
private UUID uuid;
private String firstName;
private String lastName;
private String email;
private String address_1;
private String state;
private String city;
int age; // integer
double weight; // decimal
boolean male; // true or false
String level;
public User(String firstName, String lastName) {
this.uuid = UUID.randomUUID();
this.firstName = firstName;
this.lastName = lastName;
this.level = BEGINNER;
}
@Override
public String toString() {
return "User{" +
", UUID= "+ uuid + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", address_1='" + address_1 + '\'' +
", state='" + state + '\'' +
", city='" + city + '\'' +
", age=" + age +
", weight=" + weight +
", male=" + male +
", level='" + level + '\'' +
'}';
}
public String getFullName(){
return firstName + " " + lastName;
}
}
package io.jpotts18.algoritms;
import java.util.ArrayList;
import java.util.List;
public class Workout {
private String name; // Jeffs Killer workout
private int minutes;
private List<Exercise> exerciseList;
public Workout(String name, int minutes){
this.name = name;
Exercise pullups = new Exercise("Pull-ups", 10, 2);
Exercise pushups = new Exercise("Push-ups", 10, 2);
Exercise benchPress = new Exercise("Bench Press", 3, 5);
Exercise squats = new Exercise("Squats", 3, 5);
this.exerciseList = new ArrayList<Exercise>();
this.exerciseList.add(pullups);
this.exerciseList.add(pushups);
this.exerciseList.add(benchPress);
this.exerciseList.add(squats);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment