Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ex02l04;
- import java.util.Scanner;
- public class Ex02L04 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- float calc;
- System.out.println("Informar sexo: ");
- char sexo;
- sexo = sc.next().charAt(0);
- System.out.println("Informar altura: ");
- float alt = sc.nextFloat();
- if (sexo == 'f' || sexo == 'F') {
- calc = (62.1f * alt)-44.7f;
- System.out.println("Seu peso ideal é: " + calc);
- }else if(sexo == 'm' || sexo == 'M'){
- calc = (72.7f * alt)- 58f;
- System.out.println("Seu peso ideal é: " + calc);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement