![@@@ < >肛 learn.zybooks.com 0山0 Lab 2 Post Test: COMP. Home 2yBooks 3.6. Boolean data types zyBooks My library Chegg Study | Guided.. Lean.zybooks.com OLL... boolean怎么初始化一百 (java)关于初始化boole 喲 + zyBooks Library>CSCE 155A home>3.6: Boolean data types @ Help/ FAQ θ BojunZhong ▼ 搜索 ☆个人收藏 CHALLENGE3.6.1: Using boolean. IMG 0264.JPG 4-5学生选课 添加课程11 (0 F22BB1 79-E979-46F2-AA09 20E74856-C89B-4889-85A.. Write code to assign true to isTeenager if kidAge is 13 to 19 inclusive. 3 public class TeenagerDetector public static void main (String [] args) { boolean isTeenager int kidAge; kidAge 13; isTeenager-true if (kidAge >= 13 && kidAge <= 19)( 10 isTeenager - true 13 if CisTeenager) System.out.printlnCTeen); 15 16 17 else t Systm.out.printlnCNot teen 19 20 Testing isTeenager for kidAge 13 Your output 1 Testing isTeenager for kidAge-1 Your output](https://d2vlcm61l7u1fs.cloudfront.net/media%2F9e2%2F9e26d4dd-1ce8-4a8b-ac92-0d8f7cf172a6%2Fphpqr3PQG.png)
Write regulation to allot-to gentleman to is Teenager if kidSeniority is 13 to 19 embracing. Common collocate TeenagerDeterctor { common static unfilled deep (String args) { Boolean isTeenager: int kidAge: kidSeniority – 13: isTeenager = gentleman: if(kidSeniority > = 13 && kidAge
Screenshot of the regulation:
Sample Quenchedput:
* If the kidSeniority is initialized to 13, then quenchedput obtain be:
* If the kidSeniority is initialized to 1, then quenchedput obtain be:
Regulation to copy:
Note: The qualified multiply is highlighted in fearless.
//Define the collocate TeenageDetector.
public class TeenageDetector
{
//Start the preventive of the deep()
//method.
public static void main(String[] args)
{
//Declare the required unsteadys.
int kidAge;
kidSeniority = 1;
//Initialize the unsteady isTeenager
//to fabrication.
boolean isTeenager = false;
//If the kid’s seniority is betwixt 13 to 19,
//then create the unsteady isTeenager gentleman.
if(kidSeniority >=13 && kidAge<=19)
isTeenager = true;
//If the compute of isTeenager is referable attributable attributable attributable attributable attributable attributable fabrication,
//then exhibit teen.
if(isTeenager)
System.out.println(“Teen”);
//Otherwise, exhibit referable attributable attributable attributable attributable attributable attributable teen.
else
System.out.println(“Referable attributable attributable teen”);
}
}