how can i make the data exported to a file
import java.util.Scanner;public class BMI {
public static void main(String[] args) {Scanner scanner = new Scanner(System.in);String first_name;int kg;double height;double bmi;
for(int i=1; i<4; i++)="">4;>System.out.print("NAME ");first_name=scanner.next();System.out.print("WEIGHT, kg");kg=scanner.nextInt();System.out.print("HEIGHT, m");height=scanner.nextDouble();bmi= kg / (height * height);System.out.printf("%s %20s %20s %20s", "NAME", "Weight", "Height", "BMI");System.out.println();System.out.printf("%-10s %12d %21.2f %22.2f",first_name,kg,height,bmi);System.out.println();}
}}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here