Write an ifelse statement that checks patronAge If 55 or gre

Write an if-else statement that checks patronAge. If 55 or greater, print \"Senior citizen\", otherwise print \"Not senior citizen\" (without quotes). End with newline. import java.util.Scanner; public class DetectSenior {public static void main (String [] args) {int patronAge = 0; patronAge = 55;/* Your solution goes here */return;}}

Solution

if - else statement :-

import java.util.Scanner;
public class DetectSenior
{
public static void main(String[ ] args)
{
  
int patronAge = 0;

patronAge = 55;
  
if( patronAge >= 55 )
{
System.out.println(\"Senior citizen\") ;
}
else
{
System.out.println(\" Not Senior citizen \") ;
}

System.out.println(\"\ \") ;

return ;
}
}

 Write an if-else statement that checks patronAge. If 55 or greater, print \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site