SlideShare una empresa de Scribd logo
1 de 10
ECET 370 Week 1 Lab 1
For more classes visit
www.snaptutorial.com
General Instructions
Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled
“User-defined classes."
Exercises 7 and 8 use the programs in DocSharinglabeled “Using
interfaces."
Exercise 1: Review of classes Create a project using the classes in the
DocSharing area labeled “User-defined classes." Compile it, run it,
and review the code that is given carefully.
Exercise 2: User-defined methods The function area of the Triangle
class is the framework of the actual method. Modify it so that it
calculates the area of the triangle. Write a Main class to test your area
method. Note: to calculate the area of a triangle from the vertices, first
find the distances between each pair of vertices to obtain the length of
the sides of the triangle. Then apply Heron’s formula to calculate the
area given the length of the sides.
Exercise 3: Shallow versus deep copy Provide an example of shallow
copy of objects and an example of deep copy of objects.
Exercise 4: Passing parameters to methods Write a function that
swaps two Point objects. Use the code given below: import java.util.*;
public class Main { public Main() { Scanner Scanner(System.in);
System.out. print("Enter x and y coordinates of first point: "); Point
Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x
and y coordinates of second point: "); Point Point (in.nextDouble(),
in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run
it, and review the code that is given carefully. Note: The class Point
implements the Comparable interface. The Comparable interface
contains a single method: compareTo, which is used to compare two
objects p and q of the same class type. When calling p.compareTo(q),
it returns an integer. If this value is negative it means that p is smaller;
if it is equal to zero then , and if the value is positive, it indicates that
p is greater than q.
Exercise 8: Implementation of interfaces Using the class Point in the
DocSharing area labeled “Using interfaces," write an application that
declares an array of Points, fills the array with random points, and
finds the smallest point in the array.
**************************************************************
ECET 370 Week 1 Lab 1
For more classes visit
www.snaptutorial.com
General Instructions
Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled
“User-defined classes."
Exercises 7 and 8 use the programs in DocSharinglabeled “Using
interfaces."
Exercise 1: Review of classes Create a project using the classes in the
DocSharing area labeled “User-defined classes." Compile it, run it,
and review the code that is given carefully.
Exercise 2: User-defined methods The function area of the Triangle
class is the framework of the actual method. Modify it so that it
calculates the area of the triangle. Write a Main class to test your area
method. Note: to calculate the area of a triangle from the vertices, first
find the distances between each pair of vertices to obtain the length of
the sides of the triangle. Then apply Heron’s formula to calculate the
area given the length of the sides.
Exercise 3: Shallow versus deep copy Provide an example of shallow
copy of objects and an example of deep copy of objects.
Exercise 4: Passing parameters to methods Write a function that
swaps two Point objects. Use the code given below: import java.util.*;
public class Main { public Main() { Scanner Scanner(System.in);
System.out. print("Enter x and y coordinates of first point: "); Point
Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x
and y coordinates of second point: "); Point Point (in.nextDouble(),
in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run
it, and review the code that is given carefully. Note: The class Point
implements the Comparable interface. The Comparable interface
contains a single method: compareTo, which is used to compare two
objects p and q of the same class type. When calling p.compareTo(q),
it returns an integer. If this value is negative it means that p is smaller;
if it is equal to zero then , and if the value is positive, it indicates that
p is greater than q.
Exercise 8: Implementation of interfaces Using the class Point in the
DocSharing area labeled “Using interfaces," write an application that
declares an array of Points, fills the array with random points, and
finds the smallest point in the array.
**************************************************************
ECET 370 Week 2 Lab 2
For more classes visit
www.snaptutorial.com
General Instructions
Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User-
defined array list."
Exercise 4 uses the programs in DocSharinglabeled “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. intgetSize(): 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.
**************************************************************
ECET 370 Week 3 Lab 3 Linked Lists
For more classes visit
www.snaptutorial.com
General Instructions
Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User-
defined linked list."
Exercise 4 uses the programs in DocSharinglabeled “Using
java.util.LinkedList."
Exercise 1: Review of Linked Lists Create a project using the classes
in the DocSharing area labeled “User-defined linked list." Compile it,
run it, and review the code that is given carefully. This code tests the
LinkedList class provided in the lecture. Extend the class Main to test
the functions isEmpty, search and remove of the class LinkedList.
Exercise 2: A User-Defined Linked List Modify the class LinkedList
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. a. toString(): modify the
display function to overload the toString function of the Object class.
b. int length(): create this function to determine the number of items
in the list (accessor function). c. void clear(): create this function to
remove all of the items from the list. After this operation is
completed, the length of the list is zero. d. void insertEnd(int item):
create this function to insert item at the end of the list. 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. int get(int location): create a function that
returns the element at the position location.
Exercise 3: Using a Linked List This exercise is similar to Exercise 3
in Lab 2, but uses the LinkedList class implemented in Exercise 2
above. That is, using the class LinkedList, write a program that uses it
to store 100 random numbers. Again, 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.LinkedList Create a
project using the class in the DocSharing area labeled “Using
java.util.LinkedList." 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.LinkedList. Exercise 5:
Using the Library Class java.util.LinkedList Rewrite Exercise 3
(above) using the class java.util.LinkedList to store the 100 random
numbers.
**************************************************************
ECET 370 Week 4 Lab 4 Complexity of
Computational Problems
For more classes visit
www.snaptutorial.com
General Instructions
Exercise 1 uses the programs in DocSharinglabeled “Minimum,"
“Factorial,” and “Sorting algorithms."
Exercise 1: Review of the Lecture Contents Create projects using the
classes in the DocSharing areas labeled “Minimum," “Factorial,” and
“Sorting algorithms." Compile them, run them, and review the code
that is given carefully. These programs test the code discussed in the
lecture.
Exercise 2: Efficiency of Algorithms Problem 2 in the Section
“Projects” at the end of Chapter 9 in the textbook: find a value of n
for which Loop B is faster.
Exercise 3: Recursion Problem 1 in the Section “Projects” at the end
of Chapter 10 in the textbook: recursive algorithm to find the square
root of a given number. Exercise 4: Sorting In this week’s lecture, the
algorithms quicksort and bubblesort are described and implemented.
In DocSharing, under the section labeled “Sorting algorithms," you
can find the class ArrayList where these sorting algorithms are
implemented. Write a Java program that times both of them for
various values of n. Create a table to record the times. Regarding the
efficiency of both sorting methods, what conclusion can be reached
from this experiment? Note: You can probably save development time
by using the program from Week 2 to generate a list of the 1000
smallest prime numbers (in random order). This list could then be
used as the input to the sorting algorithms.
**************************************************************
ECET 370 Week 5 Lab 5 Search Algorithms and
Techniques
For more classes visit
www.snaptutorial.com
General Instructions
Exercise 1 uses the programs in DocSharinglabeled “Search
algorithms."
Exercise 1: Review of the Lecture Content Create a project using the
ArrayList class and the Main class provided in DocSharing. The
ArrayList class contains implementations of the first three search
methods explained in this week’s lecture: sequential, sorted, and
binary search. The Main class uses these three methods. These
programs test the code discussed in the lecture. Compile the project,
run it, and review the code that is given carefully.
Exercise 2: Search Algorithms and Techniques Expand the project
developed in the previous exercise to perform the following
experiment: time the three search methods several times each and
record the results. Compare the running times of the three search
methods (sequential search, sorted search, and binary search) which
are obtained during the experiment. What conclusions can be drawn?
Exercise 3: Searching Applications Select one of the following two
problems to solve: Problem 1: Design and implement an algorithm
that determines whether or not a given array of elements, list1, is
completely contained within another given array of elements, list2.
Consider two different scenarios: 1) both arrays are sorted; 2) both
arrays are unsorted. Problem 2: Design an algorithm that when given
a collection of integers in an unsorted array, determines the second
smallest number (or second minimum). For example, if the array
consists of the values 12, 23, 9, 17, 3, the algorithm should report the
value 9, since it is the second smallest number in the array. Write a
function that receives an array as a parameter and returns the second
smallest number. To test your function, write a program that
populates an array with random numbers and then call your function.
Exercise 4: Hashing Suppose that the type of key in a hashing
application you are implementing is String (Sections 19.6 and 19.7 in
our textbook explain hash functions for strings). Design, implement,
and test a hash function that converts a key to a hash value. Assume
that the size of the hash table is a prime number.
**************************************************************
ECET 370 Week 7 Lab 7 Binary Trees
For more classes visit
www.snaptutorial.com
Full set of lab with working programs.
Exercise 1: Lecture review: Binary Search Tree Create a project using
the classes BinarySearchTree, Node, and Main in the DocSharing area
labeled “The BST." Compile the project, run it, and review the code
that is given carefully. These programs test the code discussed in our
lecture.
Exercise 2: An improved BST class Modify the class
BinarySearchTree so that it contains the toString method, instead of
the display method that was given originally.
Exercise 3: Using a BST in an application Use a binary search tree to
implement a dictionary that contains the keywords in the Java
language. Test it. Note that you can use the programs from the
previous exercises. For a list of the keywords in Java, visit
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.
html.
Exercise 4: Recursion and Binary Trees Write a recursive algorithm
that counts the nodes in a binary search tree.
Exercise 5: Using properties of BSTs Write an algorithm getMax to
find the maximum value stored in a binary search tree.
**************************************************************

Más contenido relacionado

La actualidad más candente

Java Static Factory Methods
Java Static Factory MethodsJava Static Factory Methods
Java Static Factory MethodsYe Win
 
Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...licservernoida
 
Avoid creating unncessary objects
Avoid creating unncessary objectsAvoid creating unncessary objects
Avoid creating unncessary objectsYe Win
 
Java Arrays and DateTime Functions
Java Arrays and DateTime FunctionsJava Arrays and DateTime Functions
Java Arrays and DateTime FunctionsJamsher bhanbhro
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional ProgrammingEelco Visser
 
Implicit conversion and parameters
Implicit conversion and parametersImplicit conversion and parameters
Implicit conversion and parametersKnoldus Inc.
 
Functional Objects & Function and Closures
Functional Objects  & Function and ClosuresFunctional Objects  & Function and Closures
Functional Objects & Function and ClosuresSandip Kumar
 
ConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONShweta Shah
 
Vector class in C++
Vector class in C++Vector class in C++
Vector class in C++Jawad Khan
 
Python advanced 3.the python std lib by example – algorithm
Python advanced 3.the python std lib by example – algorithmPython advanced 3.the python std lib by example – algorithm
Python advanced 3.the python std lib by example – algorithmJohn(Qiang) Zhang
 
Lecture 01 variables scripts and operations
Lecture 01   variables scripts and operationsLecture 01   variables scripts and operations
Lecture 01 variables scripts and operationsSmee Kaem Chann
 

La actualidad más candente (20)

Vectors in Java
Vectors in JavaVectors in Java
Vectors in Java
 
Java Static Factory Methods
Java Static Factory MethodsJava Static Factory Methods
Java Static Factory Methods
 
Collections
CollectionsCollections
Collections
 
Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...
 
Java final lab
Java final labJava final lab
Java final lab
 
Avoid creating unncessary objects
Avoid creating unncessary objectsAvoid creating unncessary objects
Avoid creating unncessary objects
 
Java codes
Java codesJava codes
Java codes
 
Java lab 2
Java lab 2Java lab 2
Java lab 2
 
CS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUALCS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUAL
 
Scala oo (1)
Scala oo (1)Scala oo (1)
Scala oo (1)
 
Java Arrays and DateTime Functions
Java Arrays and DateTime FunctionsJava Arrays and DateTime Functions
Java Arrays and DateTime Functions
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional Programming
 
Implicit conversion and parameters
Implicit conversion and parametersImplicit conversion and parameters
Implicit conversion and parameters
 
Functional Objects & Function and Closures
Functional Objects  & Function and ClosuresFunctional Objects  & Function and Closures
Functional Objects & Function and Closures
 
Java data types
Java data typesJava data types
Java data types
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
 
ConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTION
 
Vector class in C++
Vector class in C++Vector class in C++
Vector class in C++
 
Python advanced 3.the python std lib by example – algorithm
Python advanced 3.the python std lib by example – algorithmPython advanced 3.the python std lib by example – algorithm
Python advanced 3.the python std lib by example – algorithm
 
Lecture 01 variables scripts and operations
Lecture 01   variables scripts and operationsLecture 01   variables scripts and operations
Lecture 01 variables scripts and operations
 

Similar a Ecet 370 Education Organization -- snaptutorial.com

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.comshanaabe90
 
ECET 370 Redefined Education--ecet370.com
ECET 370 Redefined Education--ecet370.comECET 370 Redefined Education--ecet370.com
ECET 370 Redefined Education--ecet370.comagathachristie210
 
ECET 370 Education Planning--ecet370.com
 ECET 370 Education Planning--ecet370.com ECET 370 Education Planning--ecet370.com
ECET 370 Education Planning--ecet370.comWindyMiller46
 
ECET 370 Effective Communication/tutorialrank.com
 ECET 370 Effective Communication/tutorialrank.com ECET 370 Effective Communication/tutorialrank.com
ECET 370 Effective Communication/tutorialrank.comjonhson275
 
ECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.comECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.comkopiko106
 
ECET 370 Success Begins/Newtonhelp.com
ECET 370 Success Begins/Newtonhelp.comECET 370 Success Begins/Newtonhelp.com
ECET 370 Success Begins/Newtonhelp.comledlang1
 
ECET 370 Invent Yourself/newtonhelp.com
ECET 370 Invent Yourself/newtonhelp.comECET 370 Invent Yourself/newtonhelp.com
ECET 370 Invent Yourself/newtonhelp.comlechenau124
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02auswhit
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning materialArthyR3
 
08review (1)
08review (1)08review (1)
08review (1)IIUM
 
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.docxoreo10
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdfMemeMiner
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxjosephineboon366
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 OctSriram Raj
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxdunhamadell
 
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 .pdfinfo309708
 

Similar a Ecet 370 Education Organization -- snaptutorial.com (20)

Ecet 370 week 1 lab
Ecet 370 week 1 labEcet 370 week 1 lab
Ecet 370 week 1 lab
 
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 Redefined Education--ecet370.com
ECET 370 Redefined Education--ecet370.comECET 370 Redefined Education--ecet370.com
ECET 370 Redefined Education--ecet370.com
 
ECET 370 Education Planning--ecet370.com
 ECET 370 Education Planning--ecet370.com ECET 370 Education Planning--ecet370.com
ECET 370 Education Planning--ecet370.com
 
ECET 370 Effective Communication/tutorialrank.com
 ECET 370 Effective Communication/tutorialrank.com ECET 370 Effective Communication/tutorialrank.com
ECET 370 Effective Communication/tutorialrank.com
 
ECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.comECET 370 Inspiring Innovation--ecet370.com
ECET 370 Inspiring Innovation--ecet370.com
 
ECET 370 Success Begins/Newtonhelp.com
ECET 370 Success Begins/Newtonhelp.comECET 370 Success Begins/Newtonhelp.com
ECET 370 Success Begins/Newtonhelp.com
 
ECET 370 Invent Yourself/newtonhelp.com
ECET 370 Invent Yourself/newtonhelp.comECET 370 Invent Yourself/newtonhelp.com
ECET 370 Invent Yourself/newtonhelp.com
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning material
 
08review (1)
08review (1)08review (1)
08review (1)
 
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
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdf
 
JAVA CONCEPTS
JAVA CONCEPTS JAVA CONCEPTS
JAVA CONCEPTS
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docx
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 Oct
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
 
LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
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
 

Último

Strategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationStrategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationAdnet Communications
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.hyt3577
 
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...priyasharma62062
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...priyasharma62062
 
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...Call Girls Mumbai
 
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfCocity Enterprises
 
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...kajalverma014
 
7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator OptionsVince Stanzione
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetSareena Khatun
 
Vip Call Girls Rasulgada😉 Bhubaneswar 9777949614 Housewife Call Girls Servic...
Vip Call Girls Rasulgada😉  Bhubaneswar 9777949614 Housewife Call Girls Servic...Vip Call Girls Rasulgada😉  Bhubaneswar 9777949614 Housewife Call Girls Servic...
Vip Call Girls Rasulgada😉 Bhubaneswar 9777949614 Housewife Call Girls Servic...Call Girls Mumbai
 
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call GirlsKurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call GirlsPriya Reddy
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfAdnet Communications
 
Pension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfPension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfHenry Tapper
 
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiple
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai MultipleDubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiple
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiplekojalpk89
 
Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...robinsonayot
 
logistics industry development power point ppt.pdf
logistics industry development power point ppt.pdflogistics industry development power point ppt.pdf
logistics industry development power point ppt.pdfSalimullah13
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...jeffreytingson
 
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...sanakhan51485
 

Último (20)

Strategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationStrategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate Presentation
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
 
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
Female Russian Escorts Mumbai Call Girls-((ANdheri))9833754194-Jogeshawri Fre...
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
 
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
 
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdfMASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
MASTERING FOREX: STRATEGIES FOR SUCCESS.pdf
 
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
Female Escorts Service in Hyderabad Starting with 5000/- for Savita Escorts S...
 
7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options7 tips trading Deriv Accumulator Options
7 tips trading Deriv Accumulator Options
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
 
W.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdfW.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdf
 
Vip Call Girls Rasulgada😉 Bhubaneswar 9777949614 Housewife Call Girls Servic...
Vip Call Girls Rasulgada😉  Bhubaneswar 9777949614 Housewife Call Girls Servic...Vip Call Girls Rasulgada😉  Bhubaneswar 9777949614 Housewife Call Girls Servic...
Vip Call Girls Rasulgada😉 Bhubaneswar 9777949614 Housewife Call Girls Servic...
 
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call GirlsKurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
Kurla Capable Call Girls ,07506202331, Sion Affordable Call Girls
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdf
 
Pension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfPension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdf
 
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiple
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai MultipleDubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiple
Dubai Call Girls Deira O525547819 Dubai Call Girls Bur Dubai Multiple
 
Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...
 
logistics industry development power point ppt.pdf
logistics industry development power point ppt.pdflogistics industry development power point ppt.pdf
logistics industry development power point ppt.pdf
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
 
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 

Ecet 370 Education Organization -- snaptutorial.com

  • 1. ECET 370 Week 1 Lab 1 For more classes visit www.snaptutorial.com General Instructions Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled “User-defined classes." Exercises 7 and 8 use the programs in DocSharinglabeled “Using interfaces." Exercise 1: Review of classes Create a project using the classes in the DocSharing area labeled “User-defined classes." Compile it, run it, and review the code that is given carefully. Exercise 2: User-defined methods The function area of the Triangle class is the framework of the actual method. Modify it so that it calculates the area of the triangle. Write a Main class to test your area method. Note: to calculate the area of a triangle from the vertices, first find the distances between each pair of vertices to obtain the length of the sides of the triangle. Then apply Heron’s formula to calculate the area given the length of the sides. Exercise 3: Shallow versus deep copy Provide an example of shallow copy of objects and an example of deep copy of objects. Exercise 4: Passing parameters to methods Write a function that swaps two Point objects. Use the code given below: import java.util.*; public class Main { public Main() { Scanner Scanner(System.in); System.out. print("Enter x and y coordinates of first point: "); Point Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x and y coordinates of second point: "); Point Point (in.nextDouble(), in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run it, and review the code that is given carefully. Note: The class Point implements the Comparable interface. The Comparable interface
  • 2. contains a single method: compareTo, which is used to compare two objects p and q of the same class type. When calling p.compareTo(q), it returns an integer. If this value is negative it means that p is smaller; if it is equal to zero then , and if the value is positive, it indicates that p is greater than q. Exercise 8: Implementation of interfaces Using the class Point in the DocSharing area labeled “Using interfaces," write an application that declares an array of Points, fills the array with random points, and finds the smallest point in the array. ************************************************************** ECET 370 Week 1 Lab 1 For more classes visit www.snaptutorial.com General Instructions Exercises 1, 2, 4, and 5 use the programs in DocSharinglabeled “User-defined classes." Exercises 7 and 8 use the programs in DocSharinglabeled “Using interfaces." Exercise 1: Review of classes Create a project using the classes in the DocSharing area labeled “User-defined classes." Compile it, run it, and review the code that is given carefully. Exercise 2: User-defined methods The function area of the Triangle class is the framework of the actual method. Modify it so that it calculates the area of the triangle. Write a Main class to test your area
  • 3. method. Note: to calculate the area of a triangle from the vertices, first find the distances between each pair of vertices to obtain the length of the sides of the triangle. Then apply Heron’s formula to calculate the area given the length of the sides. Exercise 3: Shallow versus deep copy Provide an example of shallow copy of objects and an example of deep copy of objects. Exercise 4: Passing parameters to methods Write a function that swaps two Point objects. Use the code given below: import java.util.*; public class Main { public Main() { Scanner Scanner(System.in); System.out. print("Enter x and y coordinates of first point: "); Point Point (in.nextDouble(), in.nextDouble()); System.out. print("Enter x and y coordinates of second point: "); Point Point (in.nextDouble(), in.nextDouble()); swap(p1, p2); System.out.println(" Compile it, run it, and review the code that is given carefully. Note: The class Point implements the Comparable interface. The Comparable interface contains a single method: compareTo, which is used to compare two objects p and q of the same class type. When calling p.compareTo(q), it returns an integer. If this value is negative it means that p is smaller; if it is equal to zero then , and if the value is positive, it indicates that p is greater than q. Exercise 8: Implementation of interfaces Using the class Point in the DocSharing area labeled “Using interfaces," write an application that declares an array of Points, fills the array with random points, and finds the smallest point in the array. ************************************************************** ECET 370 Week 2 Lab 2 For more classes visit
  • 4. www.snaptutorial.com General Instructions Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User- defined array list." Exercise 4 uses the programs in DocSharinglabeled “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. intgetSize(): 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
  • 5. 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. ************************************************************** ECET 370 Week 3 Lab 3 Linked Lists For more classes visit www.snaptutorial.com General Instructions Exercises 1, 2, and 3 use the programs in DocSharinglabeled “User- defined linked list." Exercise 4 uses the programs in DocSharinglabeled “Using java.util.LinkedList." Exercise 1: Review of Linked Lists Create a project using the classes in the DocSharing area labeled “User-defined linked list." Compile it, run it, and review the code that is given carefully. This code tests the
  • 6. LinkedList class provided in the lecture. Extend the class Main to test the functions isEmpty, search and remove of the class LinkedList. Exercise 2: A User-Defined Linked List Modify the class LinkedList 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. a. toString(): modify the display function to overload the toString function of the Object class. b. int length(): create this function to determine the number of items in the list (accessor function). c. void clear(): create this function to remove all of the items from the list. After this operation is completed, the length of the list is zero. d. void insertEnd(int item): create this function to insert item at the end of the list. 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. int get(int location): create a function that returns the element at the position location. Exercise 3: Using a Linked List This exercise is similar to Exercise 3 in Lab 2, but uses the LinkedList class implemented in Exercise 2 above. That is, using the class LinkedList, write a program that uses it to store 100 random numbers. Again, 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.LinkedList Create a project using the class in the DocSharing area labeled “Using java.util.LinkedList." 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.LinkedList. Exercise 5: Using the Library Class java.util.LinkedList Rewrite Exercise 3 (above) using the class java.util.LinkedList to store the 100 random numbers. **************************************************************
  • 7. ECET 370 Week 4 Lab 4 Complexity of Computational Problems For more classes visit www.snaptutorial.com General Instructions Exercise 1 uses the programs in DocSharinglabeled “Minimum," “Factorial,” and “Sorting algorithms." Exercise 1: Review of the Lecture Contents Create projects using the classes in the DocSharing areas labeled “Minimum," “Factorial,” and “Sorting algorithms." Compile them, run them, and review the code that is given carefully. These programs test the code discussed in the lecture. Exercise 2: Efficiency of Algorithms Problem 2 in the Section “Projects” at the end of Chapter 9 in the textbook: find a value of n for which Loop B is faster. Exercise 3: Recursion Problem 1 in the Section “Projects” at the end of Chapter 10 in the textbook: recursive algorithm to find the square root of a given number. Exercise 4: Sorting In this week’s lecture, the algorithms quicksort and bubblesort are described and implemented. In DocSharing, under the section labeled “Sorting algorithms," you can find the class ArrayList where these sorting algorithms are implemented. Write a Java program that times both of them for various values of n. Create a table to record the times. Regarding the efficiency of both sorting methods, what conclusion can be reached from this experiment? Note: You can probably save development time by using the program from Week 2 to generate a list of the 1000
  • 8. smallest prime numbers (in random order). This list could then be used as the input to the sorting algorithms. ************************************************************** ECET 370 Week 5 Lab 5 Search Algorithms and Techniques For more classes visit www.snaptutorial.com General Instructions Exercise 1 uses the programs in DocSharinglabeled “Search algorithms." Exercise 1: Review of the Lecture Content Create a project using the ArrayList class and the Main class provided in DocSharing. The ArrayList class contains implementations of the first three search methods explained in this week’s lecture: sequential, sorted, and binary search. The Main class uses these three methods. These programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully. Exercise 2: Search Algorithms and Techniques Expand the project developed in the previous exercise to perform the following experiment: time the three search methods several times each and record the results. Compare the running times of the three search
  • 9. methods (sequential search, sorted search, and binary search) which are obtained during the experiment. What conclusions can be drawn? Exercise 3: Searching Applications Select one of the following two problems to solve: Problem 1: Design and implement an algorithm that determines whether or not a given array of elements, list1, is completely contained within another given array of elements, list2. Consider two different scenarios: 1) both arrays are sorted; 2) both arrays are unsorted. Problem 2: Design an algorithm that when given a collection of integers in an unsorted array, determines the second smallest number (or second minimum). For example, if the array consists of the values 12, 23, 9, 17, 3, the algorithm should report the value 9, since it is the second smallest number in the array. Write a function that receives an array as a parameter and returns the second smallest number. To test your function, write a program that populates an array with random numbers and then call your function. Exercise 4: Hashing Suppose that the type of key in a hashing application you are implementing is String (Sections 19.6 and 19.7 in our textbook explain hash functions for strings). Design, implement, and test a hash function that converts a key to a hash value. Assume that the size of the hash table is a prime number. ************************************************************** ECET 370 Week 7 Lab 7 Binary Trees For more classes visit www.snaptutorial.com
  • 10. Full set of lab with working programs. Exercise 1: Lecture review: Binary Search Tree Create a project using the classes BinarySearchTree, Node, and Main in the DocSharing area labeled “The BST." Compile the project, run it, and review the code that is given carefully. These programs test the code discussed in our lecture. Exercise 2: An improved BST class Modify the class BinarySearchTree so that it contains the toString method, instead of the display method that was given originally. Exercise 3: Using a BST in an application Use a binary search tree to implement a dictionary that contains the keywords in the Java language. Test it. Note that you can use the programs from the previous exercises. For a list of the keywords in Java, visit http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords. html. Exercise 4: Recursion and Binary Trees Write a recursive algorithm that counts the nodes in a binary search tree. Exercise 5: Using properties of BSTs Write an algorithm getMax to find the maximum value stored in a binary search tree. **************************************************************