Computer Science, asked by aryanrajantripathi, 10 months ago

write a java program to input name and weight of all students of a class and print name and weight of heaviest student.(using bubble sort method) Question on arrays

Answers

Answered by BhavishyaAggarwal
2

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 this help,

Please mark me as brainliest

Similar questions
Math, 5 months ago