Answer:
import java.util.Scanner;
public class TeenagerDetector {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
boolean isTeenager;
int kidAge;
kidAge = scnr.nextInt();
/* Your solution goes here */
isTeenager = (kidAge >= 13) && (kidAge <= 19);
if (isTeenager) {
System.out.println("Teen");
} else { System.out.println("Not teen"); } } }
Explanation:
A condition which check for the teenager age and return a boolean is assigned to isTeenager.
isTeenager = (kidAge >=13) && (kidAge <= 19);
So, if the kidAge is greater than/equal to 13 and less than/19, the boolean isTeenager will be true and the program will output "Teen" else "false" will be output.
The range of age for a teenager is 13 - 19.
lst = [12,10,32,3,66,17,42,99,20]
a)
for x in lst:
print(x)
b)
for x in lst:
print(str(x) + " " +str(x**2))
I think this is what you're looking for. Hope this helps!
Answer:
ACT
Explanation:
"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing." - https://greentestprep.com/resources/act-prep/act-aspire-test/
Answer:
name1 + "," + name2 + "," + name3 // concatenation of the three values
Explanation:
Following are the description of statement
- The "+" operator is used for the concatenation purpose of the three str values.
- In the given question the name1 variable contains "Neville" ,name2 contains "Dean" and name3 contains "Seamus".
- Firstly we have given the name1 after that give the comma then we use "+" for the concatenation purpose and give the name2 again we will comma and finally, we will give the variable name3 by using "+" operator.