Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I will give you an upvote solve fast Question 5[4+4) Write codes to complete the following the two tasks for the provided codes: A. Find

image text in transcribedI will give you an upvote solve fast

Question 5[4+4) Write codes to complete the following the two tasks for the provided codes: A. Find whether any student object with name "Peter" exists in the list using the contains method of the "list" object. Add required methods into the "Student" class to use the contains method B. Now sort the "list" in descending order of CGPA using Comparator class Student ! String name; int id; double cgpa: public class Main public static void main(String[] args) { ArrayList list = new ArrayList(); public Student (String name, int id, double egpa) this.name name: this.id = id; this.cgpa - copa, list.add(new Student ("Wizard", 3, 3.88)); list.add(new Student ("Peter", 2, 3.5)); list.add(new Student ("Wanda", 1, 3.88)); list.add(new Student ("Thanos", 41, 3.9)); list.add(new Student ("Yelena", 7, 3.75)); list.add(new Student ("Thor", 15, 3.89)); public Student (String name) { this.name = name; this.id = -1; this.cgpa - -1

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

^&* What is the 1/n phenomenon?

Answered: 1 week ago

Question

Write an elaborate note on marketing environment.

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago