Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Kaylee Goldbarth
- import java.util.Scanner;
- public class Chpt8_Project {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int[][] years = new int[2][10];
- for (int i = 0; i <years.length; i++) {
- System.out.println("Enter current age (must be between ages 19 and 70): ");
- years[i][0] = input.nextInt();
- System.out.println("Enter desired retirement age (can only be ages 62, 66, or 70): ");
- years[i][1] = input.nextInt();
- do{
- years[i][0] = input.nextInt();
- }while(years[i][0] < 19 && years[i][0] > 70);
- do{
- years[0][i] = input.nextInt();
- }while(years[0][i] ==62 && years[0][i] ==66 && years[0][i] ==70);
- System.out.println("The current age and desired retirement age for employee #" + (i+1) + " is: " + years[i][0] + " " + years[i][1]);
- System.out.println("Employee #" + (i+1) + " has to work" + (years[i][1] - years[i][0]) + "years before they can retire");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement