how to write this java program
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/01 13:18:47
how to write this java program
the question is:The height of an object dropped from a starting height of 100 meters is govern by the equation h=100-4.9*t^2 where t is the time in seconds.Write a program that asks the user for a time less than 20 seconds and displays the height of the object at that time using this formula.The output should look similar to:
Enter the time:2
The object is at 80.4 meter
im in usa·this is my computer homework·i cannot type in Chinese·sorry
the question is:The height of an object dropped from a starting height of 100 meters is govern by the equation h=100-4.9*t^2 where t is the time in seconds.Write a program that asks the user for a time less than 20 seconds and displays the height of the object at that time using this formula.The output should look similar to:
Enter the time:2
The object is at 80.4 meter
im in usa·this is my computer homework·i cannot type in Chinese·sorry
hi,here is my program.
it is my pleasure to help u!
import java.util.Scanner;
public class App {
/**
* @param args
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int time = 0;
do {
System.out.println("Please input a time less than 20 seconds!");
time = s.nextInt();
} while (time >= 20 || time < 0);
System.out.println("The object is at " + (100 - 4.9 * time * time)
+ " meter!");
}
}
it is my pleasure to help u!
import java.util.Scanner;
public class App {
/**
* @param args
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int time = 0;
do {
System.out.println("Please input a time less than 20 seconds!");
time = s.nextInt();
} while (time >= 20 || time < 0);
System.out.println("The object is at " + (100 - 4.9 * time * time)
+ " meter!");
}
}
how to write this java program
how to write this java program?
求电子书java how to program中文版
Java write a program to calculate the sum of each of the ser
Java write a program to read an integer,n,from the keyboard
Java write a program to calculate the factorial of any natur
write a program to represent multiplication tables.用最简单的JAVA
关于java编程问题Write an algorithm and a program to settle the fol
how to show the download speed in KB/s in a java program
help!how to write this composition?
Please write a Java program,compute the GreatestCommonDiviso
Write a program,which performs as the following:(java)