Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA ASSIGNMENT PLEASE HELP! Programming: ArrayLists The class Student, shown below, which holds name, major and credits earned for a student. Using the built-in Java

JAVA ASSIGNMENT PLEASE HELP!

Programming: ArrayLists

The class Student, shown below, which holds name, major and credits earned for a student.

Using the built-in Java ArrayList students

Write a method

public static double averageCreditsForMajor(ArrayList list, String major)

which returns the average creditsEarned for all the students in the given major from the list.

STUDENT CLASS:

public class Student { private String name; private String major; private double creditsEarned; public String getName() { return name; } public void setName(String name) { this.name = name;} public String getMajor() { return major; } public void setMajor(String major) { this.major = major; } public double getCreditsEarned() { return creditsEarned; } public void setCreditsEarned(double credits) { credits = creditsEarned; } public Student(String nam, String maj, double credits) { name = nam; major = maj; creditsEarned= credits; } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago