Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. package ex02l04;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Ex02L04 {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.         float calc;
  10.         System.out.println("Informar sexo: ");
  11.         char sexo;
  12.         sexo = sc.next().charAt(0);
  13.         System.out.println("Informar altura: ");
  14.         float alt = sc.nextFloat();
  15.         if (sexo == 'f' || sexo == 'F') {
  16.              calc = (62.1f * alt)-44.7f;
  17.             System.out.println("Seu peso ideal é: " + calc);
  18.         }else if(sexo == 'm' || sexo == 'M'){
  19.              calc = (72.7f * alt)- 58f;
  20.             System.out.println("Seu peso ideal é: " + calc);
  21.         }
  22.            
  23.        
  24.     }
  25.    
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement