Devry Ecet 370 Week 1 Lab 1

In: Other Topics

Submitted By zantoutha
Words 392
Pages 2
DEVRY ECET 370 Week 1 Lab 1

Check this A+ tutorial guideline at

http://www.ecet370assignment.com/ecet-370/ecet-370-week-1-lab-1

For more classes visit http://www.ecet370assignment.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…...

Similar Documents

Ecet 370 Week 1 Lab

...This work of ECET 370 Week 1 Lab consists of: Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6 Exercise 7 Exercise 8 User Defined Classes Using Interfaces Exercises 1, 2, 4, and 5 use the programs in DocSharing labeled “User-defined classes." Exercises 7 and 8 use the programs in DocSharing labeled “Using interlaces." 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.nexlDouble()); System.out.......

Words: 819 - Pages: 4

Ecet 370 Week 2 Lab 2

...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......

Words: 1041 - Pages: 5

Ecet 370 Week 5 Lab 5

...This work of ECET 370 Week 5 Lab 5 shows the solutions to the following problems: Exercise 1 Exercise 2 Exercise 3/2 Exercise 4 General Instructions Exercise 1 uses the programs in DocSharing labeled "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, listl, is completely contained within another given array of elements, Iist2. Consider two different scenarios: 1) both arrays are sorted; 2) both arrays are unsorted. Problem 2: Design an algorithm that when......

Words: 788 - Pages: 4

Ecet 370 Entire Course (Devry)

...ECET 370 Entire Course (Devry) Purchase here http://devrycourse.com/ECET%20370/ecet-370-entire-course-devry Product Description ECET 370 Week 1 Lab 1 ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://devrycourse.com/ECET%20370/ecet-370-entire-course-devry Product Description ECET 370 Week 1 Lab 1 ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://devrycourse.com/ECET%20370/ecet-370-entire-course-devry Product Description ECET 370 Week 1 Lab 1 ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://devrycourse.com/ECET%20370/ecet-370-entire-course-devry Product Description ECET 370 Week 1 Lab 1 ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab......

Words: 871 - Pages: 4

Ecet 370 Week 3 Lab 3 Linked Lists

...ECET 370 Week 3 Lab 3 Linked Lists Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-3-lab-3-linked-lists Product Description ECET 370 Week 3 Lab 3 Linked Lists Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-3-lab-3-linked-lists Product Description General Instructions Exercises 1, 2, and 3 use the programs in DocSharing labeled “User-defined linked list." Exercise 4 uses the programs in DocSharing labeled “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......

Words: 2594 - Pages: 11

Ecet 370 Week 2 Lab 2

...ECET 370 Week 2 Lab 2 Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-2-lab-2 Product Description 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,......

Words: 2471 - Pages: 10

Ecet 370 Week 1 Lab 1

...ECET 370 Week 1 Lab 1 Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-1-lab-1 Product Description General Instructions Exercises 1, 2, 4, and 5 use the programs in DocSharing labeled “User-defined classes." Exercises 7 and 8 use the programs in DocSharing labeled “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...

Words: 2661 - Pages: 11

Ecet 370 Week 4 Lab 4 Complexity of Computational Problems

...ECET 370 Week 4 Lab 4 Complexity of Computational Problems Purchase here http://devrycourse.com/ECET%20370?product_id=578 Product Description General Instructions Exercise 1 uses the programs in DocSharing labeled “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......

Words: 2563 - Pages: 11

Ecet 370 Week 5 Lab 5 Search Algorithms and Techniques

...ECET 370 Week 5 Lab 5 Search Algorithms and Techniques Purchase here http://devrycourse.com/ECET%20370?product_id=578 Product Description General Instructions Exercise 1 uses the programs in DocSharing labeled “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......

Words: 2563 - Pages: 11

Ecet 370 Week 7 Lab 7 Binary Trees

...ECET 370 Week 7 Lab 7 Binary Trees Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-7-lab-7-binary-trees Product Description 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. ECET 370 Week 7 Lab 7 Binary Trees Purchase here http://devrycourse.com/ECET%20370/ecet-370-week-7-lab-7-binary-trees Product Description Full set of lab with working programs. Exercise 1: Lecture review: Binary Search Tree Create a project using the classes......

Words: 1819 - Pages: 8

Ecet 340 Week 1 Home Work 1

...ECET 340 Week 1 Home Work 1 To Buy This material Click below link http://www.uoptutors.com/ecet-340-devry/ecet-340-week-1-homework-1 1. Give three examples each of internal and external peripheral devices as referenced to the HCS12 microcontroller and not an entire PC. (2 points) 2. Given “the requirements of each signal’s destination must match the capabilities of the signal’s source,” name some of the electrical signal parameters that must be considered when designing an interface between two different hardware components. (2 points) 3. Write down the instructions needed to program PORT A for pins PA7, PA4-PA0 as inputs and PA6-PA5 as outputs. Answer should be a valid C language statement. (2 points) 4. Write an instruction sequence to output the value $35 to PORT P. Use the C language only when writing your answer; – no assembly language. (2 points) 5. Write an instruction sequence to configure Port H for input, read in the current signal levels on the Port H pins, and store the value to a C variable called data1. Use the C language only when writing your answer, no assembly language. Also make sure to set the data direction register appropriately in your answer. (2 points) 6. Write a short program in C language which reads in the bits on port H, inverts the bits and adds 1 to the result, and then outputs the result onto port P. Be sure to include port initializations and variable declarations in your code. (2 points) 7. Using only Ports B, H, & J, (see......

Words: 422 - Pages: 2

Ecet 370 Week 1 Lab 1

...ECET 370 Week 1 Lab 1 To Buy This material Click below link http://www.uoptutors.com/ecet-370/ecet-370-week-1-lab-1 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(),......

Words: 392 - Pages: 2

Ecet 370 Week 2 Lab 2

...ECET 370 Week 2 Lab 2 To Buy This material Click below link http://www.uoptutors.com/ecet-370/ecet-370-week-2-lab-2 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):......

Words: 503 - Pages: 3

Ecet 370 Week 3 Lab 3 Linked Lists

...ECET 370 Week 3 Lab 3 Linked Lists To Buy This material Click below link http://www.uoptutors.com/ecet-370/ecet-370-week-3-lab-3-linked-lists 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......

Words: 438 - Pages: 2

Ecet 370 Entire Course (Devry)

...ECET 370 Entire Course (Devry) Purchase here http://sellfy.com/p/T6vN/ Product Description ECET 370 Week 1 Lab 1ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://sellfy.com/p/T6vN/ Product Description ECET 370 Week 1 Lab 1ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://sellfy.com/p/T6vN/ Product Description ECET 370 Week 1 Lab 1ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://sellfy.com/p/T6vN/ Product Description ECET 370 Week 1 Lab 1ECET 370 Week 2 Lab 2 ECET 370 Week 3 Lab 3 Linked Lists ECET 370 Week 4 Lab 4 Complexity of Computational Problems ECET 370 Week 5 Lab 5 Search Algorithms and Techniques ECET 370 Week 7 Lab 7 Binary Trees ECET 370 Entire Course (Devry) Purchase here http://sellfy.com/p/T6vN/ Product Description ECET 370 Week 1 Lab 1ECET......

Words: 1403 - Pages: 6