For an intro to Java assign. This is what I got so far. Not sure why it keeps sa
ID: 3557813 • Letter: F
Question
For an intro to Java assign. This is what I got so far. Not sure why it keeps saying "input is never closed"
Let me know if I am in the right direction or if you have a different suggestion
----------------------------------------------------------------------------------------------------------------
import java.util.Scanner;
public class ComputerConfiguration{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
double Budget = input.nextDouble();
System.out.print("enter budget");
if (Budget <= 205.99) {
int Cost;
Cost = 99;
double ShippingAndHandling;
ShippingAndHandling = 7.99;
double Total;
Total = ( Cost * 2) + ShippingAndHandling;
System.out.println("The Lenovo ThinkPad laptop satisfies all the needs of a college student.");
System.out.println("The price also satisfies the budget of a college student");
System.out.println("Processer - Intel
import java.util.Scanner;
public class ComputerConfiguration{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
double Budget = input.nextDouble();
System.out.print("enter budget");
if (Budget <= 205.99) {
int Cost;
Cost = 99;
double ShippingAndHandling;
ShippingAndHandling = 7.99;
double Total;
Total = ( Cost * 2) + ShippingAndHandling;
System.out.println("The Lenovo ThinkPad laptop satisfies all the needs of a college student.");
System.out.println("The price also satisfies the budget of a college student");
System.out.println("Processer - Intel
Explanation / Answer
import java.util.Scanner;
public class ComputerConfiguration{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
System.out.print("enter budget ");
double Budget = input.nextDouble();
if (Budget <= 205.99) {
int Cost;
Cost = 99;
double ShippingAndHandling;
ShippingAndHandling = 7.99;
double Total;
Total = ( Cost * 2) + ShippingAndHandling;
System.out.println("The Lenovo ThinkPad laptop satisfies all the needs of a college student. ");
System.out.println("The price also satisfies the budget of a college student ");
System.out.println("Processer - Intel
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.