Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package p79reviewpt2;
- import java.util.Scanner;
- public class P79ReviewPt2 {
- public static void main(String[] args) {
- double seg1;
- double seg2;
- double seg3;
- try (Scanner input = new Scanner(System.in)) {
- System.out.print("Enter the first segment length:");
- seg1 = input.nextDouble();
- System.out.print("Enter the second segment length:");
- seg2 = input.nextDouble();
- System.out.print("Enter the third segment length:");
- seg3= input.nextDouble();
- double total = seg1+seg2+seg3;
- System.out.print(total +"km was the total length of the race");
- }
- }
- }
Add Comment
Please, Sign In to add comment