Question: Explain why doesnt the following source code work properly and write the solution to fix the issue. (20 Points) import java.util.Scanner; public class About {

Explain why doesnt the following source code work properly and write the solution to fix the issue. (20 Points)

import java.util.Scanner;

public class About

{

public static void main(String[] args)

{

String name;

int height;

double income;

Scanner keyboard = new Scanner(System.in);

System.out.print(What is your height? );

height = keyboard.nextInt();

System.out.print(What is your annual income? );

income = keyboard.nextDouble();

System.out.print(What is your name? );

name = keyboard.nextLine();

System.out.println(Hello, + name . Your height is + height + and your income is $ + income);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!