// Arup Guha
// 9/28/2026
// Shoe Class

public class Shoe {

	// How much sole we lose per step.
	private final static int WALK_PER_STEP = 1;
	private final static int RUN_PER_STEP = 2;

	private String brand;
	private String color;
	private double cost;
	private int remainingSole;
	
	// Creates a shoe object using the info given.
	public Shoe(String myBrand, String myColor, double myCost, int totalTread) {
		brand = myBrand;
		color = myColor;
		cost = myCost;
		remainingSole = totalTread;
	}
	
	public String toString() {
		return color+" "+brand+" remaining sole = "+remainingSole;
	}
	
	// Attempts to walk numSteps on these shoes.
	// Returns actual number of steps walked.
	public int walk(int numSteps) {
	
		// How far I'll actually walk.
		int dist = Math.min(numSteps, remainingSole/WALK_PER_STEP);
		
		// We lose 1 pt per walking step.
		remainingSole -= WALK_PER_STEP*dist;
		
		// How much I actually walked.
		return dist;
	}
	
	// Attempts to run numSteps on these shoes.
	// REturns actual number of steps walked.
	public int run(int numSteps) {
	
		// How far I'll actually walk.
		int dist = Math.min(numSteps, remainingSole/RUN_PER_STEP);
		
		// We lose 1 pt per walking step.
		remainingSole -= RUN_PER_STEP*dist;
		
		// How much I actually ran.
		return dist;
	}
	
	// Returns true iff there's no tread left on this shoe.
	public boolean noTreadLeft() {
		return remainingSole == 0;
	}

}