Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. /*
  2.  *Harjoitus 2 tehtävä 8
  3.  *Tuomas Piirainen (Piirainen.Tuomas.O@student.uta.fi)
  4.  *
  5.  */
  6.  
  7. public class Teht8 {
  8.  public static void main(String [] args) {
  9.  
  10.   double matka;
  11.  
  12.   double aika;
  13.  
  14.   System.out.println("Lasketaan keskinopeus.");
  15.  
  16.   System.out.print("Anna matka:");
  17.  
  18.   matka = In.readDouble();
  19.  
  20.   System.out.print("Anna aika:");
  21.  
  22.   aika = In.readDouble();
  23.  
  24.   km/h = matka/aika;
  25.  
  26.   System.out.println("Keskinopeus on " + km/h + "km/h.");
  27.  
  28.  }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement