CS173: Intro to Computer Science - Introduction to Primitive Data Types and Expressions Revisited (3 Points)
Developed by Professor Tralie and Professor Mongan.Exercise Goals
The goals of this exercise are:- To become familiar with the basic structure of a Java program
- To write a Java statement
- To declare a variable
- To manipulate a variable with arithmetic statements
Enter your Ursinus netid before clicking run. This is not your ID number or your email. For example, my netid is wmongan
(non Ursinus students can simply enter their name to get this to run, but they won't get an e-mail record or any form of credit)
Netid |
Driver.java
public class Driver {
public static void main(String[] args) {
float g = 9.80665; // Gravitational Constant on Earth in m/s
/* TODO: Declare a float variable representing the amount of time that
an object fell due to gravity. Set this variable to 5 seconds. */
/* TODO: Print out the distance the object was in free-fall, which is (1/2) * g * time^2 */
}
}
Driver.main(null);