Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

explain WHY the answer is the way it is, DONT *only* type the answer, I need to know HOW you got it PLEASE! 6.3.6 Print

 explain WHY the answer is the way it is, DONT *only* type the answer, I need to know HOW you got it PLEASE!


image

6.3.6 Print Odds Submit + Continue Save Output Test Cases Docs Assignment Grade More 1 public class PrintOdds 2- 5 points Status: Not Submitted 3 public static void main(String[] args) 4- { 5 int[] values = {17, 34, 56, 2, 19, 100}; In this exercise, rewrite the for loop in the starter code, which prints out the odd numbers in an array, as an enhanced for-each loop. 6 7 8 - { 9 for (int i = 0; i < values.length; i++) if (values[i] % 2 1) 10 11 } 12 } 13} System.out.println(values [i] + is odd"); "

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To rewrite the for loop in the starter code as an enhanced foreach loop we need to understand the st... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Operations management processes and supply chain

Authors: Lee J Krajewski, Larry P Ritzman, Manoj K Malhotra

9th edition

9788131728840, 136065767, 8131728846, 978-0136065760

More Books

Students also viewed these Programming questions

Question

When slicing in Python what does the 2 in [ :: 2 ] specify?

Answered: 1 week ago