CSCI 260 Fall 2024 --- Programming Assignment 1
Submit deadline: 16:00, 27 September 2024, Friday

Objectives

This assignment is worth 5% of your final grade.

Problem Description

Your task is to develop a C++ program that simulates a computer job queue (or sometimes called a batch queue).

There are two types of jobs in a computer system: system jobs and user jobs.

When a program starts and waits to be executed, a job is created and is inserted to the job queue for processing. Each job would contain the following information:

When the computer is ready to process the next job in the job queue, it always processes system jobs ahead of any user jobs. Among the same typed jobs, the shortest job will be processed first. (Hint: a job's type and its estimated execution time determines the job's priority.)

Your program should interactively accept and handle the following commands:

This is an interactive program and it should shutdown only when the command quit is entered.

Your program can safely assume that the user will enter numbers for the estimated execution time. However, the appropriate error checking needs to be done to make sure the numbers fall in the right range.

If the job type entered for a job is neither "system" nor "user", or any other invalid data is entered for the job's information (such as a negative number entered for the estimated execution time), then this job request is discarded with a proper explanation message.

You must design and implement your own Priority Queue ADT for this assignment. And the expected performance of the operations insert and removeMin must be O(logN) where N indicates the number of jobs in your job queue.

Design and Documentation

Your source code file should have the proper documentation, such as the header comment for each file, description of the functionality for each function/method unless the name of the function/method is self-explanatory, and some proper in-line comment to improve the readability of the implementation.

You need to include a README file with your solution. In your README file (Note: do not give it any extension name), there should be following sections:

Create a Makefile to automate the building of your program. Upon typing make, an executable file named pex1 should be generated.

If your program has compile time errors, you lose all the execution correctness marks (which is about 70 percent of the total marks) for this assignment.

Submission

To submit your solution, change working directory to where your solution is located and run the following command:

~liuh/bin/submit 260 Pex1 .

The submit script currently accept Makefile, README, typescript, *.cpp, *.h, src/*.cpp and include/*.h files.

If this command is successfully executed, it should show you a list of the files just got submitted to the instructor's directory. If you submit your assignment more than once, all but the last one will be discarded. Take advantage of this feature, submit early and submit often. Your assignment must be submitted before the due date and time.

You can check what you have submitted for this assignment by running the following command:

~liuh/bin/checksubmit 260 Pex1