Computer Science, asked by UtkarshChawhan, 8 months ago

Question :
Write a program in Java to accept the age and the weight of a person and display
whether he/she will be able to donate blood or not.
Condition : If the person is above 20 years and weight is more than 60 kgs then only
he/she will be eligible to donate blood else not.​

Answers

Answered by SarvPratham
7

import java.util.*;

class BloodDonation

{

public static void main()

{

Scanner sc = new Scanner(System.in);

SOP(" Your Age (in yrs): ");

int a = sc.nextInt();

SOP(" Your Weight (in kg) : ");

int w = sc.nextInt();

if( a>=20 && w>=60 )

SOPln(" You are eligible to donate blood. ");

else

SOPln(" You are not eligible to donate blood. ");

// Remember : Don't leave lines where I haven't left

}

}

Answered by sanjupandey534
2

Answer:

import java. io. *;

class looping

{

public static void main( Strong args[ ]) throws IOException

{

BufferedReader br = new BufferedReader (new InputStreamReader (System.in)) ;

int age, w;

System. out. println("Enter age and weight of person ") ;

{

if (age>20 and w>60)

System. out. println(" Eligible to donate blood ") ;

else

System. out. println (" Not eligible to donate blood ");

}

}

}

Explanation:

I hope it's clear......

Similar questions