Skip to content

Instantly share code, notes, and snippets.

@PocasPedro
Created September 25, 2017 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PocasPedro/116838f88ba5462a339da75ab00f0616 to your computer and use it in GitHub Desktop.
Save PocasPedro/116838f88ba5462a339da75ab00f0616 to your computer and use it in GitHub Desktop.
Java Fundaments for Kids - Exercise 1
/**
Simple Program that prints the Speed of Light in meters per second. Coded by Pedro.
*/
public class SpeedOfLight {
public static void main(String[] args) {
//I have used an integer because the needed value fits the range of an integer. I have not used a DataType wrapper here to keep it simple.
int sol = 299792458;
// Prints "The light speed is ... m/s" to the terminal window.
System.out.println("The light speed is: " + sol + " m/s!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment