Question: PLEASE COMPLETE ALL EXERCISES!!!! AND CLEARLY, LABEL WHICH CODE BELONGS TO WHICH EXERCISE 1.Exercise 6.3.6 2.Exercise 6.3.7 3.Exercise 6.3.8 4.Exercise 6.3.9 The following assignments are

 PLEASE COMPLETE ALL EXERCISES!!!! AND CLEARLY, LABEL WHICH CODE BELONGS TOWHICH EXERCISE 1.Exercise 6.3.6 2.Exercise 6.3.7 3.Exercise 6.3.8 4.Exercise 6.3.9 The followingassignments are incomplete java codes that should match the assignment instructions givenon the right-hand side, please make sure the Java code you postis correct and answers the assignment instructions given. 6.3.6: Print Odds SaveSubmit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE

PLEASE COMPLETE ALL EXERCISES!!!! AND CLEARLY, LABEL WHICH CODE BELONGS TO WHICH EXERCISE

1.Exercise 6.3.6

2.Exercise 6.3.7

3.Exercise 6.3.8

4.Exercise 6.3.9

The following assignments are incomplete java codes that should match the assignment instructions given on the right-hand side, please make sure the Java code you post is correct and answers the assignment instructions given.

6.3.6: Print Odds Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted 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. 1 public class PrintOdds 2- { 3 public static void main(String[] args) 4- { 5 int[ ] values = {17, 34, 56, 2, 19, 100}; 6 7 for (int i 0; i maxSoFar) 20 { 21 maxSoFar num; 22 } 23 } 24 return maxSoFar; 25 } 26 } 6.3.8: Classroom Array Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted In this exercise, use the Student class to print out each student using a for-each loop with their first name, last name and grade level. You will need to finish the class with the appropriate getter (accessor) methods for last name and grade level. You must print in the for each loop, and NOT use the toString method in the class. Output: Julian Jones is in grade 9 Larisa Torres is in grade 10 Amada Robin is in grade 10 Mikka Leads is in grade 9 Jay Khalil is in grade 10 Julian Jones is in grade: 9 1 - /** 2 * The Student class holds data about a student. 3 * The fields are firstName, lastName, and grade. 4. */ 5 public class Student 6- { 7 // Attributes 8 private String firstName; 9 private String lastName; 10 private int gradeLevel; 11 12 // Constructor 13 public Student(String fName, String lName, int grade) 14 { 15 firstName fName; 16 lastName Z Name; 17 gradeLevel = grade; 18 } 19 20 public String getFirstName() 21 { 22 return firstName; 23 } 24 25 // new getter 26 public String getLastName() 27- { 28 29 } 30 31 // new getter 32 public int getGradeLevel() 33 { 34 35 } 36 37 - /* 38 public String toString() 39 { 40 return firstName + + lastName + is in grade: 41 } 42 */ 43 } 44 + gradeLevel; O 6.3.8: Classroom Array Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted In this exercise, use the Student class to print out each student using a for-each loop with their first name, last name and grade level. You will need to finish the class with the appropriate getter (accessor) methods for last name and grade level. 1 public class ClassRoster 2- { 3 public static void main(String[] args) 4 - { 5 Student julian new Student("Julian", "Jones", 9); 6 Student larisa = new Student("Larisa", "Torres", 10); 7 Student amada new Student("Amada", "Robin", 10); 8 Student mikka new Student("Mikka", "Leads", 9); 9 Student jay = new Student("Jay", "Khalil", 10); 10 11 Student[] classroom {julian, larisa, amada, mikka, jay}; 12 13 // for each for printing goes here 14 } 16 } 17 You must print in the for each loop, and NOT use the toString method in the class. Output: 15 Julian Jones is in grade 9 Larisa Torres is in grade 10 Amada Robin is in grade 10 Mikka Leads is in grade 9 Jay Khalil is in grade 10 Julian Jones is in grade: 9 6.3.9: Array Average Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted Complete the getAverage() method in the ArrayAverage class using a for-each loop. Create an ArrayAverage object and print the result. Your output should be: = 1 public class ArrayAverage 2-{ private int[] values; 4 5 public ArrayAverage(int[] theValues) { 7 values theValues; 8 } 9 10 public double getAverage() 11 { 12 // your code goes here! 13 } 14 } The average of the array is 36.5 O 6.3.9: Array Average Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted Complete the getAverage() method in the ArrayAverage class using a for-each loop. Create an ArrayAverage object and print the result. 1 public class ArrayAverage Tester 2 - { 3 4 public static void main(String[] args) 5 { 6 int[] numArray {12, 17, 65, 7, 30, 88}; 7 8 // Create an ArrayAverage object and print the result 9 } 10 11 Your output should be: The average of the array is 36.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!