I need the program to print out a statement providing the child adult height in a decimal format of feet (using the modulus) (for ex if the child's height is 5'7" the display should read "The child's adult height would be 5.58'
import java.text.NumberFormat;
import java.util.Scanner;
public class Workshop3GenderModification {
public static void main(String[] args) {
int gender;
gender = 'M';
gender = 'F';
double cheight=0;
Scanner input = new Scanner(System.in);
//father height
System.out.print("Enter your father height in feet ");
int ffeet=input.nextInt();
System.out.print("Enter father height in inches ");
int finches=input.nextInt();
//mother height
System.out.print("Enter mother height in feet ");
int mfeet=input.nextInt();
System.out.print("Enter mother height in inches ");
int minches=input.nextInt();
int mheight = mfeet * 12 + minches;
int fheight = ffeet * 12 + finches;
// child gender
System.out.print("Enter M for male or F for female ");
gender = input.next().charAt (0);
// male or female
input.nextLine();
switch (gender){
case 'M':
case 'm':
cheight =(int)((fheight * 13/12.0)+ mheight)/2;
break;
case 'F' :
case 'f' :
cheight =(int)((mheight * 12/13.0) + fheight)/2 ;
break;
default:
System.out.print("Invalid entry. Please enter only M,F,m or f. ");
break;
}
int cfeet= (int)cheight/12;
int cinched= (int)cheight%12;
double aheight=(cfeet/cinched);
System.out.print(cfeet +"'" + cinched + "\"");
System.out.printf(" will be the adult child's height." +" %.2f", aheight);
}
}