Use the code below for questions 4 and S string shape 1 . \"circle. String shape
ID: 3910519 • Letter: U
Question
Use the code below for questions 4 and S string shape 1 . "circle. String shape2 Square string shape3Triangle string q4 String q5 shape 1. index0t('i') .# 2 ll shape3.contains (-1") ? "Yes" : "No"; shape2.substring (5) .equals("e*) “ shape2.indexOf (.q')-1 ? -Yes. : -No"; What is the value of q4? O Yes No D Question 5 3 pts Use the code below for questions 4 and S String shape1Circle" String shape2 Square String shape3 Triangle" string q4- shape1.indexot( 2II shape3.contains(Yea String q5 - shape2. substring (5).equals("o") “ shape2. What is the value of q5? (Note that the code in the image is the same as the previous question) Yes 3 4 5Explanation / Answer
Question 4
Answer: Yes
shape1.indexOf("I")==2 will return false but shape1.contains("i") will return true. so false || true will return true. so Q4 value is Yes
Question 5
Answer: Yes
shape2.substring(5) will return "e" and shape2.indexOf(1) will return 'q'. so true && true will return true. so Q5 value is Yes
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.