Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package distance.part.pkg2.of.pkg2;
- import java.util.Scanner;
- /**
- *
- * @author Monty
- */
- public class DistancePart2Of2 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- double d1;
- double d2;
- double d3;
- Scanner input = new Scanner(System.in);
- System.out.print("Enter the first distance: ");
- d1 = input.nextDouble();
- System.out.print("Enter the second distance: ");
- d2 = input.nextDouble();
- System.out.print("Enter the third distance: ");
- d3 = input.nextDouble();
- double dt;
- dt = d1 + d2 + d3;
- System.out.println("Total distance: " + dt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment