import java.util.Scanner;
public class creditScore
{
public static void main(String[]args)
{
// declare and initialize variables
int creditScore;
double loanAmount,interestRate,interestAmount;
final double I_a = 5.56,I_b = 6.38,I_c = 7.12,I_d = 9.34,I_e = 12.45,I_f = 0;
String instructions = "This program calculates annual interest\n"+"based on a credit score.\n\n";
String output;
Scanner input = new Scanner(System.in);// for receiving input from keyboard
// get input from user
System.out.println(instructions );
System.out.println("Enter the loan amount: $");
loanAmount = input.nextDouble();
System.out.println("Enter the credit score: ");
creditScore = input.nextint();
System.out.println();// print blank line
//process data
if(creditScore>=720&&creditScore<=850)
interestRate = I_a;
else if(creditScore>=690&&creditScore<=719)
interestRate = I_b;
else if(creditScore>=660&&creditScore<=689)
interestRate = I_c;
else if(creditScore>=625&&creditScore<=689)
interestRate = I_d;
else if(creditScore>=590&&creditScore<=624)
interestRate = I_e;
else if(creditScore<590)
interestRate = I_f;
interestAmount = loanAmount*interestRate;
// output
output = "The loan amount is $" +loanAmount + "\n"
+ "The credit score is" + creditScore + "\n"
+ "The interest rate is" + interestRate + "\n"
+ "The interest is $" + interestAmount + "\n"
+ "End of program\n\n";
// display output
System.out.println(output);
}//end main
}//end class
output-
creditScore.java:28: error: cannot find symbol
creditScore = input.nextint();
^
symbol: method nextint()
location: variable input of type Scanner
1 error
please fix the error and update it
Program:
import java.io.*;
import java.util.Scanner;
public class CreditScore
{
public static void main(String[]args)throws IOException
{
// declare and initialize variables
int creditScore;
double loanAmount,interestRate=0.0,interestAmount;
// Here we are initializing interestRate as
0.0
final double I_a = 5.56,I_b = 6.38,I_c = 7.12,I_d = 9.34,I_e =
12.45,I_f = 0;
String instructions = "This program calculates annual
interest\n"+"based on a credit score.\n\n";
String output;
Scanner input = new Scanner(System.in);// for receiving input from
keyboard
// get input from user
System.out.println(instructions );
System.out.println("Enter the loan amount: $");
loanAmount = input.nextDouble();
System.out.println("Enter the credit score: ");
creditScore = input.nextInt(); // Here in nextInt I mst be
capital
System.out.println();// print blank line
//process data
if(creditScore>=720&&creditScore<=850)
interestRate = I_a;
else if(creditScore>=690&&creditScore<=719)
interestRate = I_b;
else if(creditScore>=660&&creditScore<=689)
interestRate = I_c;
else if(creditScore>=625&&creditScore<=689)
interestRate = I_d;
else if(creditScore>=590&&creditScore<=624)
interestRate = I_e;
else if(creditScore<590)
interestRate = I_f;
interestAmount = loanAmount*interestRate;
// output
output = "The loan amount is $" +loanAmount + "\n"
+ "The credit score is" + creditScore + "\n"
+ "The interest rate is" + interestRate + "\n"
+ "The interest is $" + interestAmount + "\n"
+ "End of program\n\n";
// display output
System.out.println(output);
}//end main
}//end class
Output:

import java.util.Scanner; public class creditScore { public static void main(String[]args) { // declare and initialize variables...
import java.util.Scanner; import java.util.ArrayList; public class P3A2_BRANDT_4005916 { public static void main(String[] args) { String name; String answer; int correct = 0; int incorrect = 0; Scanner phantom = new Scanner(System.in); System.out.println("Hello, What is your name?"); name = phantom.nextLine(); System.out.println("Welcome " + name + "!\n"); System.out.println("My name is Danielle Brandt. " +"This is a quiz program that...
Project 7-3 Guessing Game import java.util.Scanner; public class GuessNumberApp { public static void main(String[] args) { displayWelcomeMessage(); // create the Scanner object Scanner sc = new Scanner(System.in); String choice = "y"; while (choice.equalsIgnoreCase("y")) { // generate the random number and invite user to guess it int number = getRandomNumber(); displayPleaseGuessMessage(); // continue until the user guesses the number int guessNumber = 0; int counter = 1; while (guessNumber != number) { // get a valid int from user guessNumber...
Explain this java code, please. import java.util.Scanner; public class Program11 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); final int maxSize = 128; String[] titles = new String[maxSize]; int[] lengths = new int[maxSize]; int numDVDs = 0; String op; op = menu(stdIn); System.out.println(); while (!op.equalsIgnoreCase("q")) { if (op.equalsIgnoreCase("a")) { if (numDVDs < maxSize) numDVDs = addDVD(titles, lengths, numDVDs, stdIn); } else if (op.equalsIgnoreCase("t")) searchByTitle(titles, lengths, numDVDs, stdIn); else if (op.equalsIgnoreCase("l")) searchByLength(titles, lengths, numDVDs, stdIn); System.out.println('\n');...
import java.util.Scanner; public class Age { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int a; System.out.println("Input your age"); a = sc.nextInt(); boolean mess = isAllowed(a); String mess2 = ?isAllowed(a)return"You are allowed to vote";:"You arent allowed"; String age = personAge(a); personAge(a); } public static String personAge(int age) { String mess = ""; if(age<18) return mess = "You are minor"; else if(age>=18 && age<=22) return mess = "You are legal you can vote"; else if(age>=22 && age<=60) return...
//LinkedList
import java.util.Scanner;
public class PoD
{
public static void main( String [] args )
{
Scanner in = new Scanner( System.in );
LinkedList teamList = new LinkedList();
final int TEAM_SIZE = Integer.valueOf(in.nextLine());
for (int i=0; i<TEAM_SIZE; i++)
{
String newTeamMember = in.nextLine();
teamList.append(newTeamMember);
}
while (in.hasNext())
{
String removeMember = in.nextLine();
teamList.remove(removeMember);
}
System.out.println("FINAL TEAM:");
System.out.println(teamList);
in.close();
System.out.print("END OF OUTPUT");
}
}
===========================================================================================
//PoD
import java.util.NoSuchElementException;
/**
* A listnked list is a sequence of nodes with...
import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String inputMonth; int inputDay; inputMonth = scnr.nextString(); inputDay = scnr.nextInt(); String season; if(inputMonth == "April","May","June"){ String season = "Spring"; }else if(inputMonth == "July","August","September"){ String season = "Summer"; }else if(inputMonth == "October","November","December"){ String season = "Autumn"; }else if(inputMonth == "January","February","March"){ System.out.println("Winter"); }else{ System.out.println("Invalid"); } if((inputMonth == "March") && (inputDay >= 20)){ String season = "Spring"; }else if((inputMonth == "June") && (inputDay >= 21)){...
import java.util.Scanner; public class MPGMain { public static void main(String[] args) { Scanner input = new Scanner(System.in); Mileage mileage = new Mileage(); System.out.println("Enter your miles: "); mileage.setMiles(input.nextDouble()); System.out.println("Enter your gallons: "); mileage.setGallons(input.nextDouble()); System.out.printf("MPG : %.2f",mileage.getMPG()); } } public class Mileage { private double miles; private double gallons; public double getMiles()...
public static void main(String[] args) { System.out.println("Welcome to the Future Value Calculator\n"); Scanner sc = new Scanner(System.in); String choice = "y"; while (choice.equalsIgnoreCase("y")) { // get the input from the user System.out.println("DATA ENTRY"); double monthlyInvestment = getDoubleWithinRange(sc, "Enter monthly investment: ", 0, 1000); double interestRate = getDoubleWithinRange(sc, "Enter yearly interest rate: ", 0, 30); int years = getIntWithinRange(sc, "Enter number of years: ", 0, 100); System.out.println(); ...
import java.util.Scanner; public class TriangleMaker { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Welcome to the Triangle Maker! Enter the size of the triangle."); Scanner keyboard = new Scanner(System.in); int size = keyboard.nextInt(); for (int i = 1; i <= size; i++) { for (int j = 0; j < i; j++) { System.out.print("*"); } System.out.println(); } for (int...
import java.util.Scanner; public class TempConvert { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); //ask the user for a temperature System.out.println("Enter a temperature:"); double temp = scnr.nextDouble(); //ask the user for the scale of the temperature System.out.println("Is that Fahrenheit (F) or Celsius (C)?"); char choice = scnr.next().charAt(0); if(choice == 'F') { //convert to Celsius if given temperature was Fahrenheit System.out.println(temp + " degrees Fahrenheit is " + ((5.0/9) * (temp-32)) + " degrees Celsius"); } else {...