Can anyone help me write a program for school? I am fairly new to programming and would appreciate some help.
The problem:
The velocity of a truck moving in one dimensional motion is given by the expression below.
v=0.25t^3
Write a program that will numerically estimate the distance traveled by the truck in the first 4 seconds of motion. Have it estimate using time intervals of 0.01 s.
@andywestken the loop can be from 1 to 400. Each .01 seconds can be put into the integral I have defined above. Absolutely the integral is relevant here.
// pseudo code
// pick out your unit system, I 'd go with meter and second
//
// then : distance in meter -> hint double
// then : time in second -> hint double
// then : speed in meter/second -> hint double
func speed(distance, time) // returns meter per second
{
return distance / time;
}
func distance(speed, time) // returns meters
{
return speed * time;
}
func time(distance, speed) // returns seconds
{
return distance / speed;
}