Question
Java code file inserted below. To complete this program you will need to add the if statement and output statement. Once you add the code,
Java code file inserted below. To complete this program you will need to add the if statement and output statement. Once you add the code, run the program to assure it runs appropriately and upload your java file here for grading. The program determines a person's eligibility for a car loan. You will need to output the following if they do qualify "You are qualified for automotive financing" If they do not qualify you need to output "Sorry, you do not qualify for financing" You will most likely need to create a nested if statement to determine qualifications.
import java.util.Scanner;
/*
This program demonstrates a nested if statement.
*/
public class CarLoanQualifier
{
public static void main(String[] args)
{
double salary; // Annual salary
double yearsOnJob; // Years at current job
// Create a Scanner object for keyboard input.
Scanner keyboard = new Scanner(System.in);
// Get the user's annual salary.
System.out.print("Enter your annual salary: ");
salary = keyboard.nextDouble();
// Get the number of years at the current job.
System.out.print("Enter the number of years " +
"at your current job: ");
yearsOnJob = keyboard.nextDouble();
// Determine whether the user qualifies for the loan.
//Enter your if statement and output statment(s) below
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started