SlideShare a Scribd company logo
Part I
Write the complete class definition (or server) for UnsortedStringList as described in Chapter 3
of the text.
Part II
Using UnsortedStringList, create a client program that performs the following tasks.
1. Create a list that can hold up to nine planets.
2. Add planets to the list.
3. Delete the first planet inserted into the list.
4. Check to see if Earth is in the list. If so, print "Earth is in the list", otherwise print "Earth is
not in the list".
5. Print the names of all planets in the list.
Solution
import java.util.*;
public class UnsortedStringList {
public static void main(String args[]) {
//Creation of list
ArrayList list = new ArrayList();
//Adding planets to the list
list.add("Mercury");
list.add("Venus");
list.add("Earth");
list.add("Mars");
list.add("Jupiter");
list.add("Saturn");
list.add("Urenus");
list.add("Neptune");
list.add("Pluto");
//Delete 1st element added to list
list.remove(0);
//Check to see if Earth is in the list.
if(list.contains("Earth"))
{
System.out.println("Earth is in the list");
}
else
{
System.out.println("Earth is not in the list");
}
//Print the names of all planets in the list.
System.out.println("List : "+list);
}
}

More Related Content

Similar to Part I Write the complete class definition (or server) for Unsorte.pdf

Array list
Array listArray list
Array list
vishal choudhary
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
amazing2001
 
In this homework- you will write a program modify program you wrote in.pdf
In this homework- you will write a program modify program you wrote in.pdfIn this homework- you will write a program modify program you wrote in.pdf
In this homework- you will write a program modify program you wrote in.pdf
EvanpZjSandersony
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
rishabjain5053
 
Write a function which return a list of all of the n element subset .pdf
Write a function which return a list of all of the n element subset .pdfWrite a function which return a list of all of the n element subset .pdf
Write a function which return a list of all of the n element subset .pdf
hardjasonoco14599
 
import java.util.; public class IteratorDemo {public static voi.pdf
import java.util.; public class IteratorDemo {public static voi.pdfimport java.util.; public class IteratorDemo {public static voi.pdf
import java.util.; public class IteratorDemo {public static voi.pdf
anilgoelslg
 
Algo>Stacks
Algo>StacksAlgo>Stacks
Algo>Stacks
Ain-ul-Moiz Khawaja
 
I need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdfI need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdf
fantoosh1
 
I need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdfI need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdf
fonecomp
 
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
ssuserc77a341
 
I really need help with the code for this in Java.Set operations u.pdf
I really need help with the code for this in Java.Set operations u.pdfI really need help with the code for this in Java.Set operations u.pdf
I really need help with the code for this in Java.Set operations u.pdf
dbrienmhompsonkath75
 
In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdf
fantoosh1
 
Create a JAVA Program that traverses through an array recursively- rat.docx
Create a JAVA Program that traverses through an array recursively- rat.docxCreate a JAVA Program that traverses through an array recursively- rat.docx
Create a JAVA Program that traverses through an array recursively- rat.docx
mrichard5
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
ravikapoorindia
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdf
maheshkumar12354
 
helpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdfhelpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdf
almonardfans
 
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdfHomework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
ezzi97
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
aryan9007
 
File LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdfFile LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdf
Conint29
 

Similar to Part I Write the complete class definition (or server) for Unsorte.pdf (20)

Array list
Array listArray list
Array list
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
 
In this homework- you will write a program modify program you wrote in.pdf
In this homework- you will write a program modify program you wrote in.pdfIn this homework- you will write a program modify program you wrote in.pdf
In this homework- you will write a program modify program you wrote in.pdf
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
 
Write a function which return a list of all of the n element subset .pdf
Write a function which return a list of all of the n element subset .pdfWrite a function which return a list of all of the n element subset .pdf
Write a function which return a list of all of the n element subset .pdf
 
import java.util.; public class IteratorDemo {public static voi.pdf
import java.util.; public class IteratorDemo {public static voi.pdfimport java.util.; public class IteratorDemo {public static voi.pdf
import java.util.; public class IteratorDemo {public static voi.pdf
 
Algo>Stacks
Algo>StacksAlgo>Stacks
Algo>Stacks
 
I need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdfI need help with this code working Create another project and add yo.pdf
I need help with this code working Create another project and add yo.pdf
 
I need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdfI need help creating a parametized JUnit test case for the following.pdf
I need help creating a parametized JUnit test case for the following.pdf
 
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
 
I really need help with the code for this in Java.Set operations u.pdf
I really need help with the code for this in Java.Set operations u.pdfI really need help with the code for this in Java.Set operations u.pdf
I really need help with the code for this in Java.Set operations u.pdf
 
In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdf
 
Create a JAVA Program that traverses through an array recursively- rat.docx
Create a JAVA Program that traverses through an array recursively- rat.docxCreate a JAVA Program that traverses through an array recursively- rat.docx
Create a JAVA Program that traverses through an array recursively- rat.docx
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdf
 
helpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdfhelpInstructionsAdd the function max as an abstract function to .pdf
helpInstructionsAdd the function max as an abstract function to .pdf
 
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdfHomework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 
File LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdfFile LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdf
 

More from fashioncollection2

All programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdfAll programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdf
fashioncollection2
 
After a (not very successful) trick or treating round, Candice has 1.pdf
After a (not very successful) trick or treating round, Candice has 1.pdfAfter a (not very successful) trick or treating round, Candice has 1.pdf
After a (not very successful) trick or treating round, Candice has 1.pdf
fashioncollection2
 
Why steroids can cross the cell membraneWhy steroids can cross .pdf
Why steroids can cross the cell membraneWhy steroids can cross .pdfWhy steroids can cross the cell membraneWhy steroids can cross .pdf
Why steroids can cross the cell membraneWhy steroids can cross .pdf
fashioncollection2
 
Write a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdfWrite a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdf
fashioncollection2
 
Write a command in unixlinux to Display all the files whose names e.pdf
Write a command in unixlinux to Display all the files whose names e.pdfWrite a command in unixlinux to Display all the files whose names e.pdf
Write a command in unixlinux to Display all the files whose names e.pdf
fashioncollection2
 
Why is “Profit” a problematic target Please consider in your answer.pdf
Why is “Profit” a problematic target Please consider in your answer.pdfWhy is “Profit” a problematic target Please consider in your answer.pdf
Why is “Profit” a problematic target Please consider in your answer.pdf
fashioncollection2
 
Which of the following statements about protists is falsea) There a.pdf
Which of the following statements about protists is falsea) There a.pdfWhich of the following statements about protists is falsea) There a.pdf
Which of the following statements about protists is falsea) There a.pdf
fashioncollection2
 
Which cable type would be used to connect a router to a switchA. .pdf
Which cable type would be used to connect a router to a switchA. .pdfWhich cable type would be used to connect a router to a switchA. .pdf
Which cable type would be used to connect a router to a switchA. .pdf
fashioncollection2
 
What is the role of abiotic factors in the formation of biomesS.pdf
What is the role of abiotic factors in the formation of biomesS.pdfWhat is the role of abiotic factors in the formation of biomesS.pdf
What is the role of abiotic factors in the formation of biomesS.pdf
fashioncollection2
 
What information needs to be encoded in a loadstorebranchALU inst.pdf
What information needs to be encoded in a loadstorebranchALU inst.pdfWhat information needs to be encoded in a loadstorebranchALU inst.pdf
What information needs to be encoded in a loadstorebranchALU inst.pdf
fashioncollection2
 
What are the major terrestrial adaptations of plants1- List the F.pdf
What are the major terrestrial adaptations of plants1- List the F.pdfWhat are the major terrestrial adaptations of plants1- List the F.pdf
What are the major terrestrial adaptations of plants1- List the F.pdf
fashioncollection2
 
The total lung capacity of a patient is 5.5 liters. Find the patient.pdf
The total lung capacity of a patient is 5.5 liters. Find the patient.pdfThe total lung capacity of a patient is 5.5 liters. Find the patient.pdf
The total lung capacity of a patient is 5.5 liters. Find the patient.pdf
fashioncollection2
 
The insatiable demand for everything wireless, video, and Web-enable.pdf
The insatiable demand for everything wireless, video, and Web-enable.pdfThe insatiable demand for everything wireless, video, and Web-enable.pdf
The insatiable demand for everything wireless, video, and Web-enable.pdf
fashioncollection2
 
Technology is an ever-growing system that provides advantages and in.pdf
Technology is an ever-growing system that provides advantages and in.pdfTechnology is an ever-growing system that provides advantages and in.pdf
Technology is an ever-growing system that provides advantages and in.pdf
fashioncollection2
 
Suppose that the proportions of blood phenotypes in a particular pop.pdf
Suppose that the proportions of blood phenotypes in a particular pop.pdfSuppose that the proportions of blood phenotypes in a particular pop.pdf
Suppose that the proportions of blood phenotypes in a particular pop.pdf
fashioncollection2
 
Select all of the following that are true regarding evolution. Altho.pdf
Select all of the following that are true regarding evolution.  Altho.pdfSelect all of the following that are true regarding evolution.  Altho.pdf
Select all of the following that are true regarding evolution. Altho.pdf
fashioncollection2
 
Role of involvement in consumer decision-making. Identify the level .pdf
Role of involvement in consumer decision-making. Identify the level .pdfRole of involvement in consumer decision-making. Identify the level .pdf
Role of involvement in consumer decision-making. Identify the level .pdf
fashioncollection2
 
Questionsa What are some of the barriers to understanding an issu.pdf
Questionsa What are some of the barriers to understanding an issu.pdfQuestionsa What are some of the barriers to understanding an issu.pdf
Questionsa What are some of the barriers to understanding an issu.pdf
fashioncollection2
 
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdfRainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
fashioncollection2
 
Quality software project managementHow are tasks, activities, and .pdf
Quality software project managementHow are tasks, activities, and .pdfQuality software project managementHow are tasks, activities, and .pdf
Quality software project managementHow are tasks, activities, and .pdf
fashioncollection2
 

More from fashioncollection2 (20)

All programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdfAll programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdf
 
After a (not very successful) trick or treating round, Candice has 1.pdf
After a (not very successful) trick or treating round, Candice has 1.pdfAfter a (not very successful) trick or treating round, Candice has 1.pdf
After a (not very successful) trick or treating round, Candice has 1.pdf
 
Why steroids can cross the cell membraneWhy steroids can cross .pdf
Why steroids can cross the cell membraneWhy steroids can cross .pdfWhy steroids can cross the cell membraneWhy steroids can cross .pdf
Why steroids can cross the cell membraneWhy steroids can cross .pdf
 
Write a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdfWrite a method called uniqueNumbers that takes an int array as param.pdf
Write a method called uniqueNumbers that takes an int array as param.pdf
 
Write a command in unixlinux to Display all the files whose names e.pdf
Write a command in unixlinux to Display all the files whose names e.pdfWrite a command in unixlinux to Display all the files whose names e.pdf
Write a command in unixlinux to Display all the files whose names e.pdf
 
Why is “Profit” a problematic target Please consider in your answer.pdf
Why is “Profit” a problematic target Please consider in your answer.pdfWhy is “Profit” a problematic target Please consider in your answer.pdf
Why is “Profit” a problematic target Please consider in your answer.pdf
 
Which of the following statements about protists is falsea) There a.pdf
Which of the following statements about protists is falsea) There a.pdfWhich of the following statements about protists is falsea) There a.pdf
Which of the following statements about protists is falsea) There a.pdf
 
Which cable type would be used to connect a router to a switchA. .pdf
Which cable type would be used to connect a router to a switchA. .pdfWhich cable type would be used to connect a router to a switchA. .pdf
Which cable type would be used to connect a router to a switchA. .pdf
 
What is the role of abiotic factors in the formation of biomesS.pdf
What is the role of abiotic factors in the formation of biomesS.pdfWhat is the role of abiotic factors in the formation of biomesS.pdf
What is the role of abiotic factors in the formation of biomesS.pdf
 
What information needs to be encoded in a loadstorebranchALU inst.pdf
What information needs to be encoded in a loadstorebranchALU inst.pdfWhat information needs to be encoded in a loadstorebranchALU inst.pdf
What information needs to be encoded in a loadstorebranchALU inst.pdf
 
What are the major terrestrial adaptations of plants1- List the F.pdf
What are the major terrestrial adaptations of plants1- List the F.pdfWhat are the major terrestrial adaptations of plants1- List the F.pdf
What are the major terrestrial adaptations of plants1- List the F.pdf
 
The total lung capacity of a patient is 5.5 liters. Find the patient.pdf
The total lung capacity of a patient is 5.5 liters. Find the patient.pdfThe total lung capacity of a patient is 5.5 liters. Find the patient.pdf
The total lung capacity of a patient is 5.5 liters. Find the patient.pdf
 
The insatiable demand for everything wireless, video, and Web-enable.pdf
The insatiable demand for everything wireless, video, and Web-enable.pdfThe insatiable demand for everything wireless, video, and Web-enable.pdf
The insatiable demand for everything wireless, video, and Web-enable.pdf
 
Technology is an ever-growing system that provides advantages and in.pdf
Technology is an ever-growing system that provides advantages and in.pdfTechnology is an ever-growing system that provides advantages and in.pdf
Technology is an ever-growing system that provides advantages and in.pdf
 
Suppose that the proportions of blood phenotypes in a particular pop.pdf
Suppose that the proportions of blood phenotypes in a particular pop.pdfSuppose that the proportions of blood phenotypes in a particular pop.pdf
Suppose that the proportions of blood phenotypes in a particular pop.pdf
 
Select all of the following that are true regarding evolution. Altho.pdf
Select all of the following that are true regarding evolution.  Altho.pdfSelect all of the following that are true regarding evolution.  Altho.pdf
Select all of the following that are true regarding evolution. Altho.pdf
 
Role of involvement in consumer decision-making. Identify the level .pdf
Role of involvement in consumer decision-making. Identify the level .pdfRole of involvement in consumer decision-making. Identify the level .pdf
Role of involvement in consumer decision-making. Identify the level .pdf
 
Questionsa What are some of the barriers to understanding an issu.pdf
Questionsa What are some of the barriers to understanding an issu.pdfQuestionsa What are some of the barriers to understanding an issu.pdf
Questionsa What are some of the barriers to understanding an issu.pdf
 
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdfRainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
Rainfall Intensity Duration Frequency Graph ear Reture Period torm Du.pdf
 
Quality software project managementHow are tasks, activities, and .pdf
Quality software project managementHow are tasks, activities, and .pdfQuality software project managementHow are tasks, activities, and .pdf
Quality software project managementHow are tasks, activities, and .pdf
 

Recently uploaded

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 

Recently uploaded (20)

Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 

Part I Write the complete class definition (or server) for Unsorte.pdf

  • 1. Part I Write the complete class definition (or server) for UnsortedStringList as described in Chapter 3 of the text. Part II Using UnsortedStringList, create a client program that performs the following tasks. 1. Create a list that can hold up to nine planets. 2. Add planets to the list. 3. Delete the first planet inserted into the list. 4. Check to see if Earth is in the list. If so, print "Earth is in the list", otherwise print "Earth is not in the list". 5. Print the names of all planets in the list. Solution import java.util.*; public class UnsortedStringList { public static void main(String args[]) { //Creation of list ArrayList list = new ArrayList(); //Adding planets to the list list.add("Mercury"); list.add("Venus"); list.add("Earth"); list.add("Mars"); list.add("Jupiter"); list.add("Saturn"); list.add("Urenus"); list.add("Neptune"); list.add("Pluto"); //Delete 1st element added to list list.remove(0); //Check to see if Earth is in the list. if(list.contains("Earth")) { System.out.println("Earth is in the list");
  • 2. } else { System.out.println("Earth is not in the list"); } //Print the names of all planets in the list. System.out.println("List : "+list); } }