import java.io.*;

public class Integrate {
	public static void main(String argv[]) {
		double		h = 0.1,
					M = 1.0,
					F = 1.0;
		try{
			FileWriter fp = new FileWriter("out.txt");
			double v = 0.0;
			for( double t = 0.0; t < 10.0; t += h ){
				if((t >= 0.0) && (t < 4.0)) F = 1.0;
				if(t > 4.0) F = 2.0;
				v = step(v, h, F/M);
				fp.write(t+", "+v+", "+F+", "+M+"\n");
			}
			fp.close();
		} catch (IOException e) {
			System.out.println("Output file problems????: "+e.getMessage());
		}
	}

	public static double step(double v, double h, double slope){
		double 		v_new;
		v_new = v + h * slope;
		return v_new;
	}
}

