SlideShare a Scribd company logo
A+ tutorial you will find here 
https://bitly.com/12AVQV0 
This pack of ECET 370 Week 2 Lab 2 consists of: 
Exercise 1 
Exercise 2 
Exercise 3 
Exercise 4 
Exercise 5 
Outputs 
General Instructions 
Exercises 1, 2, and 3 use the programs in DocSharing labeled 
“User-defined array list." 
Exercise 4 uses the programs in DocSharing labeled “Using 
java.util.ArrayList." 
Exercise 1: Review of array-based lists Create a project using 
the classes in the DocSharing area labeled “User-defined 
array list." Compile it, run it, and review the code that is 
given carefully. 
This code tests the ArrayList class provided in the lecture. 
Exercise 2: A user-defined array list Modify the class ArrayList 
given in the lecture by adding to it the functions listed below 
for Exercise 2. In each case, the appropriate error message 
should be generated if an invalid condition occurs. For 
example, an error message should be generated when trying 
to insert an item in a given location in the list and the 
location is out of range, a. ArrayList(inl size): create a 
constructor that sets the size of the array list to the value 
passed in size (note that the class variable SIZE cannot be
final anymore), b. int length(): create this function to 
determine the number of items in the list (accessor function), 
c. int gelSize(): create this function to determine the size of 
the list (accessor function), d. void clear(): create this 
function to remove all of the items from the list. After this 
operation, the length of the list is zero, e. void replace(int 
location, int item): create this function to replace the item in 
the list at the position specified by location. The item should 
be replaced with item. f. void insert(int location, int item): 
create this function to add an item to the list at the position 
specified by location, g. void remove(int item): create this 
function to delete an item from the list. All occurrences of 
item in the list should be removed, h. int get(inl location): 
create a function that returns the element at location, i. 
public ArrayList copy(): create a function that makes a deep 
copy to another ArrayList object. 
Exercise 3: Using an array-based list Using the class ArrayList 
completed in the previous exercise, write a program that 
uses it to store 100 random numbers. Consider that each of 
these random numbers is an integer in the interval [0, 200]. 
Write the program in such a way that there are no number 
duplicates. 
Exercise 4: Review of the library class java.util. ArrayList 
Create a project using the classes in the DocSharing area 
labeled “Using java.util.ArrayList." Compile it, run it, and 
review the code that is given carefully. This code is the 
complete program given in our lecture that tests the library 
class java.util.ArrayList. 
Exercise 5: Using the library class java.util.ArrayList Rewrite 
Exercise 3 (above) using the class java.util.ArrayList to store 
the 100 random numbers.
General Questions - General Academic Questions 
General Instructions 
Exercises 1, 2, and 3 use the programs in DocSharing labeled 
“User-defined array list." 
Exercise 4 uses the programs in DocSharing labeled “Using 
java.util.ArrayList." 
Exercise 1: Review of array-based lists Create a project using 
the classes in the DocSharing area labeled “User-defined 
array list." Compile it, run it, and review the code that is 
given carefully. This code tests the ArrayList class provided in 
the lecture. 
Exercise 2: A user-defined array list Modify the class ArrayList 
given in the lecture by adding to it the functions listed below 
for Exercise 2. In each case, the appropriate error message 
should be generated if an invalid condition occurs. For 
example, an error message should be generated when trying 
to insert an item in a given location in the list and the 
location is out of range. a. ArrayList(int size): create a 
constructor that sets the size of the array list to the value 
passed in size (note that the class variable SIZE cannot be 
final anymore). b. int length(): create this function to 
determine the number of items in the list (accessor function). 
c. int getSize(): create this function to determine the size of 
the list (accessor function). d. void clear(): create this 
function to remove all of the items from the list. After this 
operation, the length of the list is zero. e. void replace(int 
location, int item): create this function to replace the item in 
the list at the position specified by location. The item should 
be replaced with item. f. void insert(int location, int item): 
create this function to add an item to the list at the position
specified by location. g. void remove(int item): create this 
function to delete an item from the list. All occurrences of 
item in the list should be removed. h. int get(int location): 
create a function that returns the element at location. i. 
public ArrayList copy(): create a function that makes a deep 
copy to another ArrayList object. 
Exercise 3: Using an array-based list Using the class ArrayList 
completed in the previous exercise, write a program that 
uses it to store 100 random numbers. Consider that each of 
these random numbers is an integer in the interval [0, 200]. 
Write the program in such a way that there are no number 
duplicates. 
Exercise 4: Review of the library class java.util.ArrayList 
Create a project using the classes in the DocSharing area 
labeled “Using java.util.ArrayList." Compile it, run it, and 
review the code that is given carefully. This code is the 
complete program given in our lecture that tests the library 
class java.util.ArrayList. 
Exercise 5: Using the library class java.util.ArrayList Rewrite 
Exercise 3 (above) using the class java.util.ArrayList to store 
the 100 random numbers. 
You want to have everything under control as you embark 
upon your college days, and you want to cater to an 
experience that will bring many good things your way. While 
college can't be perfect, you can do as much as possible to 
make your experience better. Keep reading to find out 
how!... 
https://bitly.com/12AVQV0

More Related Content

What's hot

ECET 370 Achievement Education -- www.ecet370.com
ECET 370 Achievement Education -- www.ecet370.comECET 370 Achievement Education -- www.ecet370.com
ECET 370 Achievement Education -- www.ecet370.com
shanaabe90
 
ECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.comECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.com
kopiko106
 
Array list(1)
Array list(1)Array list(1)
Array list(1)
abdullah619
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
olivergeorg
 
The Drunken Landlady
The Drunken LandladyThe Drunken Landlady
The Drunken Landlady
Ben Schmidtke III
 
List in java
List in javaList in java
List in java
nitin kumar
 
F sharp lists & dictionary
F sharp   lists &  dictionaryF sharp   lists &  dictionary
F sharp lists & dictionary
DrRajeshreeKhande
 
Collections framework
Collections frameworkCollections framework
Collections framework
Anand Buddarapu
 
L11 array list
L11 array listL11 array list
L11 array list
teach4uin
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Aijaz Ali Abro
 
Lecture 4 - Object Interaction and Collections
Lecture 4 - Object Interaction and CollectionsLecture 4 - Object Interaction and Collections
Lecture 4 - Object Interaction and Collections
Syed Afaq Shah MACS CP
 
Java Arrays and DateTime Functions
Java Arrays and DateTime FunctionsJava Arrays and DateTime Functions
Java Arrays and DateTime Functions
Jamsher bhanbhro
 
ArrayList in JAVA
ArrayList in JAVAArrayList in JAVA
ArrayList in JAVA
SAGARDAVE29
 
Lists
ListsLists
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
Edureka!
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
talha ijaz
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 

What's hot (18)

ECET 370 Achievement Education -- www.ecet370.com
ECET 370 Achievement Education -- www.ecet370.comECET 370 Achievement Education -- www.ecet370.com
ECET 370 Achievement Education -- www.ecet370.com
 
ECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.comECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.com
 
Array list(1)
Array list(1)Array list(1)
Array list(1)
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
The Drunken Landlady
The Drunken LandladyThe Drunken Landlady
The Drunken Landlady
 
List in java
List in javaList in java
List in java
 
F sharp lists & dictionary
F sharp   lists &  dictionaryF sharp   lists &  dictionary
F sharp lists & dictionary
 
Collections framework
Collections frameworkCollections framework
Collections framework
 
L11 array list
L11 array listL11 array list
L11 array list
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
Lecture 4 - Object Interaction and Collections
Lecture 4 - Object Interaction and CollectionsLecture 4 - Object Interaction and Collections
Lecture 4 - Object Interaction and Collections
 
Collections
CollectionsCollections
Collections
 
Java Arrays and DateTime Functions
Java Arrays and DateTime FunctionsJava Arrays and DateTime Functions
Java Arrays and DateTime Functions
 
ArrayList in JAVA
ArrayList in JAVAArrayList in JAVA
ArrayList in JAVA
 
Lists
ListsLists
Lists
 
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 

Viewers also liked

Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
RakutenMarketingUS
 
Halloween fun mr speedy plumbing los angeles ca
Halloween fun   mr speedy plumbing los angeles caHalloween fun   mr speedy plumbing los angeles ca
Halloween fun mr speedy plumbing los angeles ca
Mr Speedy Plumbing
 
Top 10 Beef Jerky Recipes
Top 10 Beef Jerky RecipesTop 10 Beef Jerky Recipes
Top 10 Beef Jerky Recipes
mlkhj2228
 
Elementary Essential Oil - Sandalwood Plantations
Elementary Essential Oil -  Sandalwood PlantationsElementary Essential Oil -  Sandalwood Plantations
Elementary Essential Oil - Sandalwood Plantations
John Smith
 
Market Report Summer 2015
Market Report Summer 2015Market Report Summer 2015
Market Report Summer 2015
John Smith
 
Rakuten Marketing Q3 Data Report
Rakuten Marketing Q3 Data ReportRakuten Marketing Q3 Data Report
Rakuten Marketing Q3 Data Report
RakutenMarketingUS
 
Ict cleanroom broucher
Ict cleanroom broucherIct cleanroom broucher
Ict cleanroom broucher
Quan Nguyen Van
 
Phòng sạch Nhật Hoa
Phòng sạch Nhật HoaPhòng sạch Nhật Hoa
Phòng sạch Nhật Hoa
Quan Nguyen Van
 
Shadow Fight 2 - История разработки
Shadow Fight 2 - История разработкиShadow Fight 2 - История разработки
Shadow Fight 2 - История разработки
Евгений Дябин
 
Rakuten Marketing Holiday Insights Research
Rakuten Marketing Holiday Insights Research Rakuten Marketing Holiday Insights Research
Rakuten Marketing Holiday Insights Research
RakutenMarketingUS
 
Adaptador HC-05 para Arduino
Adaptador HC-05 para ArduinoAdaptador HC-05 para Arduino
Adaptador HC-05 para Arduino
marcochella
 

Viewers also liked (11)

Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
Rakuten Marketing and Google Webinar 'How to Stuff Your Q4 Stockings With RLS...
 
Halloween fun mr speedy plumbing los angeles ca
Halloween fun   mr speedy plumbing los angeles caHalloween fun   mr speedy plumbing los angeles ca
Halloween fun mr speedy plumbing los angeles ca
 
Top 10 Beef Jerky Recipes
Top 10 Beef Jerky RecipesTop 10 Beef Jerky Recipes
Top 10 Beef Jerky Recipes
 
Elementary Essential Oil - Sandalwood Plantations
Elementary Essential Oil -  Sandalwood PlantationsElementary Essential Oil -  Sandalwood Plantations
Elementary Essential Oil - Sandalwood Plantations
 
Market Report Summer 2015
Market Report Summer 2015Market Report Summer 2015
Market Report Summer 2015
 
Rakuten Marketing Q3 Data Report
Rakuten Marketing Q3 Data ReportRakuten Marketing Q3 Data Report
Rakuten Marketing Q3 Data Report
 
Ict cleanroom broucher
Ict cleanroom broucherIct cleanroom broucher
Ict cleanroom broucher
 
Phòng sạch Nhật Hoa
Phòng sạch Nhật HoaPhòng sạch Nhật Hoa
Phòng sạch Nhật Hoa
 
Shadow Fight 2 - История разработки
Shadow Fight 2 - История разработкиShadow Fight 2 - История разработки
Shadow Fight 2 - История разработки
 
Rakuten Marketing Holiday Insights Research
Rakuten Marketing Holiday Insights Research Rakuten Marketing Holiday Insights Research
Rakuten Marketing Holiday Insights Research
 
Adaptador HC-05 para Arduino
Adaptador HC-05 para ArduinoAdaptador HC-05 para Arduino
Adaptador HC-05 para Arduino
 

Similar to Ecet 370 week 2 lab 2

ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com
donaldzs157
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
uopassignment
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
mailemail
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
mybrands2
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
nikig6806
 
01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.ppt
soniya555961
 
The second programming assignment (HW4) is designed to help you ga.docx
The second programming assignment (HW4) is designed to help you ga.docxThe second programming assignment (HW4) is designed to help you ga.docx
The second programming assignment (HW4) is designed to help you ga.docx
oreo10
 
Java.util
Java.utilJava.util
Java.util
Ramakrishna kapa
 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
SarthakSrivastava70
 
java I am trying to run my code but it is not letting me .pdf
java    I am trying to run my code but it is not letting me .pdfjava    I am trying to run my code but it is not letting me .pdf
java I am trying to run my code but it is not letting me .pdf
adinathassociates
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
Prof. Erwin Globio
 
ECET 370 Entire Course NEW
ECET 370 Entire Course NEWECET 370 Entire Course NEW
ECET 370 Entire Course NEW
shyamuopuop
 
Java collections
Java collectionsJava collections
Java collections
Hamid Ghorbani
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
info309708
 
STRINGS IN JAVA
STRINGS IN JAVASTRINGS IN JAVA
Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)
SURBHI SAROHA
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdf
arpitaeron555
 

Similar to Ecet 370 week 2 lab 2 (20)

ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Devry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab arrayDevry ecet 370 week 1 i lab array
Devry ecet 370 week 1 i lab array
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
 
01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.ppt
 
The second programming assignment (HW4) is designed to help you ga.docx
The second programming assignment (HW4) is designed to help you ga.docxThe second programming assignment (HW4) is designed to help you ga.docx
The second programming assignment (HW4) is designed to help you ga.docx
 
Java.util
Java.utilJava.util
Java.util
 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
 
java I am trying to run my code but it is not letting me .pdf
java    I am trying to run my code but it is not letting me .pdfjava    I am trying to run my code but it is not letting me .pdf
java I am trying to run my code but it is not letting me .pdf
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
 
ECET 370 Entire Course NEW
ECET 370 Entire Course NEWECET 370 Entire Course NEW
ECET 370 Entire Course NEW
 
LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
Java collections
Java collectionsJava collections
Java collections
 
Array properties
Array propertiesArray properties
Array properties
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
STRINGS IN JAVA
STRINGS IN JAVASTRINGS IN JAVA
STRINGS IN JAVA
 
Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdf
 

Recently uploaded

La transidentité, un sujet qui fractionne les Français
La transidentité, un sujet qui fractionne les FrançaisLa transidentité, un sujet qui fractionne les Français
La transidentité, un sujet qui fractionne les Français
Ipsos France
 
Exploring Ancient Mysteries Visions of Atlantis.pptx
Exploring Ancient Mysteries Visions of Atlantis.pptxExploring Ancient Mysteries Visions of Atlantis.pptx
Exploring Ancient Mysteries Visions of Atlantis.pptx
Ruth Elisabeth Hancock
 
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANEMRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
DK PAGEANT
 
erevna-influencers-social-media-stin-ellada
erevna-influencers-social-media-stin-elladaerevna-influencers-social-media-stin-ellada
erevna-influencers-social-media-stin-ellada
rvlassopoulou
 
Unique Wedding Bands For Women Who Want To Stand Out.pptx
Unique Wedding Bands For Women Who Want To Stand Out.pptxUnique Wedding Bands For Women Who Want To Stand Out.pptx
Unique Wedding Bands For Women Who Want To Stand Out.pptx
Andrews Jewelers
 
Gujarat Details in Hindi for children's for presentation in school
Gujarat Details in Hindi for children's for presentation in schoolGujarat Details in Hindi for children's for presentation in school
Gujarat Details in Hindi for children's for presentation in school
shouryajoshi5
 
What To Do If Your Ring Is Too Big? Must Read
What To Do If Your Ring Is Too Big? Must ReadWhat To Do If Your Ring Is Too Big? Must Read
What To Do If Your Ring Is Too Big? Must Read
Andrews Jewelers
 
30 Manipulation Techniques to be a smart person in society (1).pdf
30 Manipulation Techniques to be a smart person in society (1).pdf30 Manipulation Techniques to be a smart person in society (1).pdf
30 Manipulation Techniques to be a smart person in society (1).pdf
minaserver6679
 
Johnny Depp Long Hair: A Signature Look Through the Years
Johnny Depp Long Hair: A Signature Look Through the YearsJohnny Depp Long Hair: A Signature Look Through the Years
Johnny Depp Long Hair: A Signature Look Through the Years
greendigital
 
EXPERIENCE MONSTER BITES STREETWEAR APPAREL
EXPERIENCE MONSTER BITES STREETWEAR APPARELEXPERIENCE MONSTER BITES STREETWEAR APPAREL
EXPERIENCE MONSTER BITES STREETWEAR APPAREL
6ctbkfpdxz
 
Care Instructions for Activewear & Swim Suits.pdf
Care Instructions for Activewear & Swim Suits.pdfCare Instructions for Activewear & Swim Suits.pdf
Care Instructions for Activewear & Swim Suits.pdf
sundazesurf80
 
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
Kitchen on Fire
 

Recently uploaded (12)

La transidentité, un sujet qui fractionne les Français
La transidentité, un sujet qui fractionne les FrançaisLa transidentité, un sujet qui fractionne les Français
La transidentité, un sujet qui fractionne les Français
 
Exploring Ancient Mysteries Visions of Atlantis.pptx
Exploring Ancient Mysteries Visions of Atlantis.pptxExploring Ancient Mysteries Visions of Atlantis.pptx
Exploring Ancient Mysteries Visions of Atlantis.pptx
 
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANEMRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
MRS PUNE 2024 - WINNER AMRUTHAA UTTAM JAGDHANE
 
erevna-influencers-social-media-stin-ellada
erevna-influencers-social-media-stin-elladaerevna-influencers-social-media-stin-ellada
erevna-influencers-social-media-stin-ellada
 
Unique Wedding Bands For Women Who Want To Stand Out.pptx
Unique Wedding Bands For Women Who Want To Stand Out.pptxUnique Wedding Bands For Women Who Want To Stand Out.pptx
Unique Wedding Bands For Women Who Want To Stand Out.pptx
 
Gujarat Details in Hindi for children's for presentation in school
Gujarat Details in Hindi for children's for presentation in schoolGujarat Details in Hindi for children's for presentation in school
Gujarat Details in Hindi for children's for presentation in school
 
What To Do If Your Ring Is Too Big? Must Read
What To Do If Your Ring Is Too Big? Must ReadWhat To Do If Your Ring Is Too Big? Must Read
What To Do If Your Ring Is Too Big? Must Read
 
30 Manipulation Techniques to be a smart person in society (1).pdf
30 Manipulation Techniques to be a smart person in society (1).pdf30 Manipulation Techniques to be a smart person in society (1).pdf
30 Manipulation Techniques to be a smart person in society (1).pdf
 
Johnny Depp Long Hair: A Signature Look Through the Years
Johnny Depp Long Hair: A Signature Look Through the YearsJohnny Depp Long Hair: A Signature Look Through the Years
Johnny Depp Long Hair: A Signature Look Through the Years
 
EXPERIENCE MONSTER BITES STREETWEAR APPAREL
EXPERIENCE MONSTER BITES STREETWEAR APPARELEXPERIENCE MONSTER BITES STREETWEAR APPAREL
EXPERIENCE MONSTER BITES STREETWEAR APPAREL
 
Care Instructions for Activewear & Swim Suits.pdf
Care Instructions for Activewear & Swim Suits.pdfCare Instructions for Activewear & Swim Suits.pdf
Care Instructions for Activewear & Swim Suits.pdf
 
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
From Stress to Success How Oakland's Corporate Wellness Programs are Cultivat...
 

Ecet 370 week 2 lab 2

  • 1. A+ tutorial you will find here https://bitly.com/12AVQV0 This pack of ECET 370 Week 2 Lab 2 consists of: Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Outputs General Instructions Exercises 1, 2, and 3 use the programs in DocSharing labeled “User-defined array list." Exercise 4 uses the programs in DocSharing labeled “Using java.util.ArrayList." Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture. Exercise 2: A user-defined array list Modify the class ArrayList given in the lecture by adding to it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. For example, an error message should be generated when trying to insert an item in a given location in the list and the location is out of range, a. ArrayList(inl size): create a constructor that sets the size of the array list to the value passed in size (note that the class variable SIZE cannot be
  • 2. final anymore), b. int length(): create this function to determine the number of items in the list (accessor function), c. int gelSize(): create this function to determine the size of the list (accessor function), d. void clear(): create this function to remove all of the items from the list. After this operation, the length of the list is zero, e. void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item. f. void insert(int location, int item): create this function to add an item to the list at the position specified by location, g. void remove(int item): create this function to delete an item from the list. All occurrences of item in the list should be removed, h. int get(inl location): create a function that returns the element at location, i. public ArrayList copy(): create a function that makes a deep copy to another ArrayList object. Exercise 3: Using an array-based list Using the class ArrayList completed in the previous exercise, write a program that uses it to store 100 random numbers. Consider that each of these random numbers is an integer in the interval [0, 200]. Write the program in such a way that there are no number duplicates. Exercise 4: Review of the library class java.util. ArrayList Create a project using the classes in the DocSharing area labeled “Using java.util.ArrayList." Compile it, run it, and review the code that is given carefully. This code is the complete program given in our lecture that tests the library class java.util.ArrayList. Exercise 5: Using the library class java.util.ArrayList Rewrite Exercise 3 (above) using the class java.util.ArrayList to store the 100 random numbers.
  • 3. General Questions - General Academic Questions General Instructions Exercises 1, 2, and 3 use the programs in DocSharing labeled “User-defined array list." Exercise 4 uses the programs in DocSharing labeled “Using java.util.ArrayList." Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture. Exercise 2: A user-defined array list Modify the class ArrayList given in the lecture by adding to it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. For example, an error message should be generated when trying to insert an item in a given location in the list and the location is out of range. a. ArrayList(int size): create a constructor that sets the size of the array list to the value passed in size (note that the class variable SIZE cannot be final anymore). b. int length(): create this function to determine the number of items in the list (accessor function). c. int getSize(): create this function to determine the size of the list (accessor function). d. void clear(): create this function to remove all of the items from the list. After this operation, the length of the list is zero. e. void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item. f. void insert(int location, int item): create this function to add an item to the list at the position
  • 4. specified by location. g. void remove(int item): create this function to delete an item from the list. All occurrences of item in the list should be removed. h. int get(int location): create a function that returns the element at location. i. public ArrayList copy(): create a function that makes a deep copy to another ArrayList object. Exercise 3: Using an array-based list Using the class ArrayList completed in the previous exercise, write a program that uses it to store 100 random numbers. Consider that each of these random numbers is an integer in the interval [0, 200]. Write the program in such a way that there are no number duplicates. Exercise 4: Review of the library class java.util.ArrayList Create a project using the classes in the DocSharing area labeled “Using java.util.ArrayList." Compile it, run it, and review the code that is given carefully. This code is the complete program given in our lecture that tests the library class java.util.ArrayList. Exercise 5: Using the library class java.util.ArrayList Rewrite Exercise 3 (above) using the class java.util.ArrayList to store the 100 random numbers. You want to have everything under control as you embark upon your college days, and you want to cater to an experience that will bring many good things your way. While college can't be perfect, you can do as much as possible to make your experience better. Keep reading to find out how!... https://bitly.com/12AVQV0