Advertisement
ismail5g

Quesiton-1

Apr 13th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3. class country{
  4.     String CountryID;
  5.     String Name;
  6.     double totalfoodproduced;
  7.    
  8.     country(String a, String b, double c){
  9.         CountryID=a;
  10.         Name=b;
  11.         totalfoodproduced=c;
  12.     }
  13.    
  14.     void TotalFoodProduction(double x){
  15.         if(x>=5000000 && x<=500000000)
  16.             System.out.println("Country doesn't need any support from FAO");
  17.         else
  18.             System.out.println("Country need any support from FAO");
  19.     }
  20. }
  21.  
  22. class Main{
  23.     public static void main(String[] args){
  24.         Scanner input= new Scanner(System.in);
  25.         System.out.println("Enter Country Name : ");
  26.         String n= input.next();
  27.         System.out.println("Enter Country ID for separate use '-' : ");
  28.         String m= input.next();
  29.         System.out.println("Enter Total Food Produced : ");
  30.         double x= input.nextDouble();
  31.         country use = new country(n, m, x);
  32.         use.TotalFoodProduction(x);
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement