Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class country{
- String CountryID;
- String Name;
- double totalfoodproduced;
- country(String a, String b, double c){
- CountryID=a;
- Name=b;
- totalfoodproduced=c;
- }
- void TotalFoodProduction(double x){
- if(x>=5000000 && x<=500000000)
- System.out.println("Country doesn't need any support from FAO");
- else
- System.out.println("Country need any support from FAO");
- }
- }
- class Main{
- public static void main(String[] args){
- Scanner input= new Scanner(System.in);
- System.out.println("Enter Country Name : ");
- String n= input.next();
- System.out.println("Enter Country ID for separate use '-' : ");
- String m= input.next();
- System.out.println("Enter Total Food Produced : ");
- double x= input.nextDouble();
- country use = new country(n, m, x);
- use.TotalFoodProduction(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement