Write a Java program that will take user input and print his Name, Age, Blood Group, and also his Group to which he belongs in the school.
Answers
Explanation:
Scanner class is used to get input from the user, to use this class, you ... In this program we will read Name, Gender, Age and Float and then print all
Answer:
//program to input int, float and string value
import java.util.Scanner;
public class GetIpAddress
{
public static void main(String args[]) throws Exception
{
String name, gender;
int age;
float weight;
Scanner SC=new Scanner(System.in);
System.out.print("Enter name: ");
name= SC.nextLine();
System.out.print("Enter Gender (Male/Female): ");
gender=SC.next();
System.out.print("Enter age: ");
age=SC.nextInt();
System.out.print("Enter weight: ");
weight=SC.nextFloat();
System.out.println("Name: " + name);
System.out.println("Gender: " + gender);
System.out.println("Age: " + age);
System.out.println("Weight: " + weight);
}
}
Explanation:
hope it helps you
mark brainiest