Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

if or switch statement problem with 4 variables

hi guys I am a beginner and I struggled to make a this java program its an application to join a club the conditions it must be a girl and her age 10 or less and(her Wight is lower than 40 or height more than 100) I tried to do it with both if and switch statments but i failed any help please?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This will slove the problem:

String gender = "f";
short age = 9;
double weight = 39.5;
double height = 101.3;
   
if (gender.equalsIgnoreCase("f") && age <= 10 && (weight < 40 || height > 100)) 
{
 ... join the club ...
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading