HW3: Programming with stacks



Similar documents
Last not not Last Last Next! Next! Line Line Forms Forms Here Here Last In, First Out Last In, First Out not Last Next! Call stack: Worst line ever!

Outline. Computer Science 331. Stack ADT. Definition of a Stack ADT. Stacks. Parenthesis Matching. Mike Jacobson

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

Color Screen Phones: SIP-T48G and SIP-T46G with firmware version 73

Inside the Java Virtual Machine

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CompSci-61B, Data Structures Final Exam

Project 4 DB A Simple database program

Welcome to Online Speech 104

Software Documentation Guidelines

New York University Computer Science Department Courant Institute of Mathematical Sciences

Citrix Shared Desktop

COMP 356 Programming Language Structures Notes for Chapter 4 of Concepts of Programming Languages Scanning and Parsing

Using the Remote Desktop Portal

Welcome to Online Speech 104

Programming Assignment II Due Date: See online CISC 672 schedule Individual Assignment

Using the Remote Desktop Portal

1.00 Lecture 35. Data Structures: Introduction Stacks, Queues. Reading for next time: Big Java: Data Structures

FTP client Selection and Programming

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit.

COSC 6397 Big Data Analytics. Mahout and 3 rd homework assignment. Edgar Gabriel Spring Mahout

INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3

PA2: Word Cloud (100 Points)

STORM. Simulation TOol for Real-time Multiprocessor scheduling. Designer Guide V3.3.1 September 2009

The course assumes successful completion of CSCI E-50a and CSCI E-50b, i.e. at least two semesters of programming, with a grade of C- or better.

Master of Sciences in Informatics Engineering Programming Paradigms 2005/2006. Final Examination. January 24 th, 2006

CS 111 Classes I 1. Software Organization View to this point:

This lecture. Abstract data types Stacks Queues. ADTs, Stacks, Queues Goodrich, Tamassia

CS 1301 Homework 6 Scribbler Line Sensing Due: Friday March 13th, before 11:55pm PM EST. Out of 130 points Files to submit:

GETTING STARTED WITH FLEXI-CLOUD

CS170 Lab 11 Abstract Data Types & Objects

Copyright 2013 Consona Corporation. All rights reserved

Software Development with UML and Java 2 SDJ I2, Spring 2010

Crystal Reports Integration Plugin for JIRA

CP Lab 2: Writing programs for simple arithmetic problems

Web Service Caching Using Command Cache

Working with SQL Server Agent Jobs

Project 5 Twitter Analyzer Due: Fri :59:59 pm

Lab 9. Spam, Spam, Spam. Handout 11 CSCI 134: Spring, To gain experience with Strings. Objective

How to use FTP Commander

Download and Install the Citrix Receiver for Mac/Linux

Java Application Developer Certificate Program Competencies

Data Structures and Algorithms V Otávio Braga

COSC 6397 Big Data Analytics. 2 nd homework assignment Pig and Hive. Edgar Gabriel Spring 2015

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

Lecture 5: Java Fundamentals III

Experiences with Online Programming Examinations

Problem 1. CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class

Overview of Web Services API

Computer Networks Practicum 2015

Computer Science Spring 2012 Page 1. COURSE INFORMATION Introduction to Computers / COMSC / Online Section. kstanton@losmedanos.

Building a Multi-Threaded Web Server

PARALLELIZED SUDOKU SOLVING ALGORITHM USING OpenMP

Data Networks Project 2: Design Document for Intra-Domain Routing Protocols

Use your UNNCNetID and password to log in. The first time you login to the system, you may receive the following screen:

Virtual Private Server Manual

University of Pennsylvania Department of Electrical and Systems Engineering Digital Audio Basics

Sophos Mobile Control Web service guide

Mobile App Design Project #1 Java Boot Camp: Design Model for Chutes and Ladders Board Game

Getting Started with STATISTICA Enterprise Programming

Electronic Data Solutions. E-Prescription System Software Requirement Specifications. Version 1.0

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Part I. OpenCIT Server

Testing Methodology Assignment 1 Unit testing using JUnit

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Scenario: Optimization of Conference Schedule.

Chapter 3: Restricted Structures Page 1

A Meeting Room Scheduling Problem

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Preventing and Detecting Plagiarism in Programming Course

Homework 9 Android App for Weather Forecast

Outline. The Stack ADT Applications of Stacks Array-based implementation Growable array-based stack. Stacks 2

10 Java API, Exceptions, and Collections

COSC 111: Computer Programming I. Dr. Bowen Hui University of Bri>sh Columbia Okanagan

Welcome to the JReport Server Monitor User's Guide

Lecture J - Exceptions

Project 2: Bejeweled

Computer Programming I

Foundations of Programming

Vim, Emacs, and JUnit Testing. Audience: Students in CS 331 Written by: Kathleen Lockhart, CS Tutor

Step 4: Configure a new Hadoop server This perspective will add a new snap-in to your bottom pane (along with Problems and Tasks), like so:

PPM User Guide Telephone: IP Solutions, Aldermans House, Liverpool Street, London, EC2M 3UJ

In this Lecture you will Learn: Implementation. Software Implementation Tools. Software Implementation Tools

Introduction to Computer Programming Course Syllabus Fall 2015

HOW TO USE THE File Transfer Protocol SERVER ftp.architekturaibiznes.com.pl

Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 106 Introduction to Computer Science I

OXFORD UNIVERSITY DEPARTMENT FOR CONTINUING EDUCATION PANEL OF PART-TIME TUTORS. Generic Job Description for Part-time Face-to-Face Tutors

1 Intel Smart Connect Technology Installation Guide:

Secure File Transfer Protocol User Guide. Date Created: November 10, 2009 Date Updated: April 14, 2014 Version: 1.7

Engineering Problem Solving and Programming (CS 1133)

Level 3 Develop software using Java (7266/ )

TCP/IP Networking, Part 2: Web-Based Control

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

Memory Management Simulation Interactive Lab

Transcription:

HW3: Programming with stacks Due: 12PM, Noon Thursday, September 18 Total: 20pts You may do this assignment with one other student. A team of two members must practice pair programming. Pair programming "is a practice in which two programmers work side-by-side at one computer, continuously collaborating on the same design, algorithm, code, or test." Both members in a team must read the article All I really need to know about pair programming I learned in kindergarten. This article can be downloaded to any computer that is in the Marquette network. In this assignment, you will develop a program to simulate a Help Desk for computer science students seeking assistance with their homework. This rudimentary Help Desk will only be able to help one student at a time, although others may sit in a nearby stack of chairs while they wait. Because the Help Desk is aimed primarily at helping students in the introductory classes, a draconian priority policy has been set in place: If a student arrives at the help desk from a lower numbered course than the student who is currently being helped, the current student will be moved to the stack of waiting chairs until the new student has been helped. If a student arrives from a higher (or equal) course than the student currently being helped, the new student will be turned away. The HelpDesk tutor also keeps track of who is coming and going, using a pile of notecards. When the shift is over, the notecards are read back and logged in reverse order. Design and implement the HelpDesk class. Your HelpDesk class will be tested for the following API: 1. public void step() Advance the simulation one minute. 2. public void addstudent(string name, int course, int workload) Add an arriving student with the indicate name, course number, and minutes of workload. If the current student has a lower or equal course number, the arriving student is turned away. If the current student has a higher course number, the current student is preempted while the new student is helped. 3. public int gettime() Get the current simulation time in minutes. 4. public String tostring() Return the status of the simulation. This produces strings like, "Time 2, Helping Jack from COSC1010", or "Time 9, IDLE". 5. public String getlog() Return the entire HelpDesk session log. In addition to the public methods specified above, your HelpDesk class will have instance variables so that the HelpDesk tutor can keep track of students and activities. Include necessary instance variables in the HelpDesk class.

Several Stacks will be used in this assignment. Use the Stack Demonstration Code (can be downloaded at http://www.mscs.mu.edu/~brylow/cosc2100/fall2014/demos/stackdemo) from class to implement your solution. The DSLinkedStack class bears close resemblance to the Stack classes in Chapter 3 of your textbook, and has the following API: void push(t element) Adds a fresh element onto the Stack. void pop() throws StackUnderflowException Removes the top element from the Stack. T top() throws StackUnderflowException Returns the top element from the Stack without removing it. boolean isempty() Checks whether the Stack is empty. Note that this is a generic Java data structure, and can be instantiated with any Java class in place of type "T". Inputs and outputs. Input to the HelpDesk simulator will consist of an initial line with a number of minutes for the simulation to run. Each subsequent line of input will consist of an arrival time (in minutes), a name, a course number (we assume all courses are COSC, and therefore the letter code is not included,) and a workload time in minutes. If only students arrived at the Help Desk in the real world labeled with precisely how many minutes it would take to help them. Input arrival times will occur strictly in order -- so each student's arrival will be strictly greater than or equal to the previous student's. You may assume that workload times will be strictly positive, non-zero integers. Here are some example inputs and outputs. Example Run #1 Ten minute simulation, three students arrive for help at non-overlapping times. 10 2 Jack 1010 2 5 Jill 1020 2 8 Robin 2010 1 Time 2, Helping Jack from COSC1010 Time 3, Helping Jack from COSC1010 Time 4, IDLE

Time 5, Helping Jill from COSC1020 Time 7, IDLE Time 8, Helping Robin from COSC2010 Time 9, IDLE Time 9, Finished helping Robin from COSC2010 Time 8, Started helping Robin from COSC2010 Time 7, Finished helping Jill from COSC1020 Time 4, Finished helping Jack from COSC1010 Time 2, Started helping Jack from COSC1010 Example Run #2 Twenty minute simulation, three students arrive for help at overlapping times in reverse priority order. 20 2 Robin 2010 8 5 Jill 1020 6 7 Jack 1010 2 Time 2, Helping Robin from COSC2010 Time 3, Helping Robin from COSC2010 Time 4, Helping Robin from COSC2010 Time 5, Helping Jill from COSC1020 Time 7, Helping Jack from COSC1010 Time 8, Helping Jack from COSC1010 Time 9, Helping Jill from COSC1020 Time 10, Helping Jill from COSC1020 Time 11, Helping Jill from COSC1020 Time 12, Helping Jill from COSC1020 Time 13, Helping Robin from COSC2010 Time 14, Helping Robin from COSC2010 Time 15, Helping Robin from COSC2010 Time 16, Helping Robin from COSC2010 Time 17, Helping Robin from COSC2010 Time 18, IDLE Time 19, IDLE Time 18, Finished helping Robin from COSC2010 Time 13, Finished helping Jill from COSC1020 Time 9, Finished helping Jack from COSC1010 Time 7, Started helping Jack from COSC1010 Time 2, Started helping Robin from COSC2010 Example Run #3

Twenty minute simulation, third student is turned away. 20 2 Robin 2010 8 5 Jill 1020 6 7 Jack 3100 2 Time 2, Helping Robin from COSC2010 Time 3, Helping Robin from COSC2010 Time 4, Helping Robin from COSC2010 Time 5, Helping Jill from COSC1020 Time 7, Helping Jill from COSC1020 Time 8, Helping Jill from COSC1020 Time 9, Helping Jill from COSC1020 Time 10, Helping Jill from COSC1020 Time 11, Helping Robin from COSC2010 Time 12, Helping Robin from COSC2010 Time 13, Helping Robin from COSC2010 Time 14, Helping Robin from COSC2010 Time 15, Helping Robin from COSC2010 Time 16, IDLE Time 17, IDLE Time 18, IDLE Time 19, IDLE Time 16, Finished helping Robin from COSC2010 Time 11, Finished helping Jill from COSC1020 Time 7, Turned away Jack from COSC3100 Time 2, Started helping Robin from COSC2010 Submission. 1. We provide the HelpDeskRunner.java file we are using for parsing input and running the simulation. Download this file and use it as the driver. 2. Submit your source file (HelpDesk.java only) to turnin. Do not turnin the HelpDeskRunner class, or any of the Stack Demonstration Code. These files will be ignored by TA-bot, the software used to grade the assignments. Each team only needs to submit one copy. Remember to write both names in the beginning of HelpDesk.java as JavaDoc. 3. We have provided several test cases and corresponding outputs in turnin. These test cases will become available on different days. You are recommended to finish your code a couple of days before the due day, and submit your working source code to turnin to see what test cases your code passes. Note that only your last submission will be saved by the system for grading. You can login to any of the following servers to turn in helpdesk.java: morbius.mscs.mu.edu argolis.mscs.mu.edu calufrax.mscs.mu.edu gallifrey.mscs.mu.edu

kastria.mscs.mu.edu telos.mscs.mu.edu Once you are on one of the servers, make sure you have a copy of helpdesk.java on the server. Typically, you will use two commands to submit HelpDesk.java through turnin: 1. cd cosc2010-fall2014 //go to the directory where your HelpDesk.java is located. The above command assumes HelpDesk.java is under the directory of cosc2010-fall2014. 2. turnin -c cosc2010-ge -p HelpDesk HelpDesk.java //turn in helpdesk.java. Turn in HelpDesk.java to course cosc2010-ge, project HelpDesk.