logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Jun 27, 2019
      ·  Edited: Aug 29, 2019

    6.6 How to use enhanced for loops for 2-D arrays?

    in Introduction to Java

    A. Introduction

    How to traverse a 2-D array? How to sum up elements diagonally? How to use enhanced for loop for 2-D arrays?

    B. Watch ... (Slides)

    C. Now, open the code in 6.5, complete the following

    1. Find and print average, max and min heights for each class using regular for loops

    2. Find and print average, max and min heights for all 4 classes

    3. Create a new class. Assume 5 students each flip a coin 8 times. Design a 2-D boolean array to record the results and print out the ratio of heads and tails for each students. You must use enhanced for loops.

    D. Check how well you score, and see if you can find out what are wrong in these slides.

    0 comments
    0
    0 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners