subject

Assign to the variable boolean 'primeSecond' the value true if the second leading (just after the most significant) decimal digit of the value of an int variable 'n' is 2,3,5 or 7; otherwise assign 'primeSecond' the value false. Assume 'primeSecond' and 'n' are already declared and that 'n' has already been assigned a value. So if n's value is 58047 primeSecond will be false because the second leading digit of 58047 is 8 which is not 2 or 3 or 5 or 7. Instructor's notes: Hint: Use loops and division (/) and modulus (%).import java. util. Scanner; public class Test { public static void main(String [] args) { Scanner input = new Scanner(System. in); boolean primeSecond = false; System. out. print("Number: "); String num = input. nextLine(); if(num. length() > 1) { if(num. charAt(1) == '2' || num. charAt(1) == '3' || num. charAt(1) == '5' || num. charAt(1) == '7') { primeSecond=true; } } if(primeSecond) System. out. println("PrimeSecond=true"); else System. out. println("PrimeSecond=false"); } }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 1
You know the right answer?
Assign to the variable boolean 'primeSecond' the value true if the second leading (just after the mo...
Questions
question
Mathematics, 01.12.2020 01:10
question
Mathematics, 01.12.2020 01:10
question
Mathematics, 01.12.2020 01:10
question
English, 01.12.2020 01:10
Questions on the website: 13722363