Details of this Paper

ECET370 Lab 3 ? Guaranteed 100% score

Description

solution


Question

ECET370 Lab 3;iLAB OVERVIEW;Scenario and Summary;The purpose of the lab exercises is to help the student acquire skills in developing programs that involve the use of the stack and the queue data structures.;Deliverables;There are six exercises in this lab, although not all of them will be required for submission. Be sure to read the following instructions carefully.;Exercises 1 and 4: No submissions are required.;Create a folder and name it Week 3 Lab. Inside this folder, create the subfolders Ex2, Ex3, Ex5, and Ex6. Place the solution to each of the four exercises required for submission in the corresponding subfolder. Compress the folder Week 3 Lab using a program like WinZip, and drop the resulting zipped folder into the Dropbox.;Note that Exercises 2, 3, 5, and 6 require software development. Place only.java files in the corresponding folders. Do not submit the.class files or other files or folders that are generated by the IDE.;Required Software;Eclipse;Access the software at https://lab.devry.edu.;iLAB STEPS;Exercise 1: Review of the Stack ADT;Back to Top;Create a project using the classes in the Doc Sharing area labeled a simple stack class. Compile the project, run it, and review the code that is given carefully. This code tests the stack class provided in the lecture.;Exercise 2: An Improved Stack Class;Back to Top;Modify the stack class to include appropriate error messages if invalid conditions occur?for example, trying to pop an item when the stack is empty.;Exercise 3: Using a Stack in an Application;Back to Top;Complete Exercise 13 at the end of Chapter 5 in our textbook: Write Java code that displays all of the objects in a stack (s) in the order in which they were pushed onto the stack. After all of the objects are displayed, s should have the same contents as when you started.;To implement the solution to this problem, use the stack of characters from the previous exercises (1 and 2).;Note: To better understand the problem, look at this situation. Suppose you are implementing a program that requires printing the items in a stack object. Suppose also that the stack class is in a library that you are importing. That is, you don?t have access to the stack class code, so you can?t write a print function inside of the class. In this scenario, you can only use the stack operations pop, push, and peek.;13.;Write Java code that displays all the objects in a stack in the order in which they were pushed onto it. After all the objects are displayed, the stack should have the same contents as when you started.;Exercise 4: Review of the Queue ADT;Back to Top;Create a project using the classes in the Doc Sharing area labeled a simple queue class. Compile the project, run it, and review the code that is given carefully. This code tests the queue class provided in the lecture.;Exercise 5: An Improved Queue Class;Back to Top;Modify the class queue to include appropriate error messages if invalid conditions occur?for example, trying to dequeue an item when the queue is empty.;Exercise 6: Using a Queue in an Application;Back to Top;Write a program to simulate the implementation of a printer interface application. The application should consist of a print server object and document objects to be printed. The print server object should contain a queue to store the documents to be printed (therefore, the item type stored in your queue class should be a document). Each document contains the name, length in bytes, time it was sent to the printer, and the owner. Test your classes by deciding the next action randomly: a document leaves the queue (job completed), a new document arrives to the queue, or simply do nothing (the state of the system remains the same, printing, or idle).

 

Paper#68252 | Written in 18-Jul-2015

Price : $27
SiteLock