Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   Assignments (http://www.abandonia.com/vbullet/showthread.php?t=2406)

ultranewbie 14-01-2005 01:27 AM

:bye:,

I read through Kon Tiki's post on programming tutorials, and thought I would give it a go. I have just started Python, mainly because I haven't heard of that language and it sounded cool.

I have lots of computer knowledge, have been around them for over 15 years, but have never really got into programming.

ANYWAY!

I was wondering if some of you Computer Science students would mind sending me assignments?? It would be a lot easier to learn with concrete examples to work through.

Any advice on introductory programing, etc welcome.

Kon-Tiki 14-01-2005 02:06 AM

Two generic ones're: Make Connect Four for two players and make Tic-Tac-Toe for two players. Those're probably the two most frequently used programming assignments out there.

ultranewbie 14-01-2005 02:32 AM

hrm. all good, thank ye.

mika 14-01-2005 04:01 AM

Also try something that involves databases, like a simple ecommerce system.

Predator 14-01-2005 04:07 AM

Or try to create something similar to Bittorrent, as it was created in Python. ;)

Kon-Tiki 14-01-2005 12:17 PM

What's good fingerpractice too, is making a very basic RPG. Text-based if you don't want to bother with graphics. First is character creation, by choosing between race, occupation, gender, etc. Then just fighting random monsters and leveling up. No need for exploring or anything like that.

YMIHere 03-03-2005 03:44 AM

My teacher had us make designs in text without actually typing it out. Try to make something like this:

Code:

* * * * *
 ** * * *
 * * * *
 * ** *
 * * *

Without typing it out directly.

Example:
Code:

for( var/i=5; i>=0; i-- );
{
 *printf("*");
}

This should print out five astericks (if I remembered how to use C anyway). =P

NeKromancer 03-03-2005 07:05 PM

Here is an assignment I had done a few years ago.

Quote:


OPTION1: SIMULATION OF A SIMPLE SPOOLING SYSTEM
GOAL:* SCHEDULING POLICIES IMPLEMENTATION

As you are surely aware, each of our labs has a printer and a number of computers.
The users who sit in front of their machines occasionally issue a PRINT command
which causes one of their files to be printed. The users are unaware of each other's
work in general, and who is about to print what and when in particular. Each user
issues her or his print request at whim.

It goes to reason that users cannot access the printer simultaneously - the printouts so obtained would contain gibberish and so would be perfectly useless. The piece of software arbitrating the use of the printer is called the "Spooler". ("SPOOL" is an acronym for Simultaneous Peripheral Operation On-Line).

The spooler works as follows:

The PRINT command submits to the spooler the file to be printed. The spooler queues
the print requests and makes sure that all files get printed in an orderly fashion.

There are a number of possible organizations of the print queue:

1. FIFO: The printouts are produced in the order in which the print requests
were issued. The problem with this approach is that a number of short print jobs
may be made to wait uncomfortably long for a large print job submitted before them.

2. SPJF: Shortest print job first. In this approach the print queue is sorted in
ascending order of printout size (size= pages). This methodology favors short print jobs at the expense of longer jobs, which may languish in queue for uncomfortably long
periods of time. (Actually, some universities like this approach as it forces
the students to conserve paper and to reduce printing cost).

3. PAPQ: Priority-aged print queue. The print queue is sorted in descending order
of print job priority P calculated as follows: P = A + B*T, where A and B are
carefully chosen constants, while T is the amount of time a print request spent
in the queue (counted in terms of the number of print jobs completed since joining
the queue).

In PAPQ model the job with the highest priority is to be printed next.
At the time of joining the queue the priority of each job is A (since T= 0). No job is allowed to linger in the queue indefinitely (its priority increases at rate B as it waits).

4. LBAQ: Length-based aged queue: Similar to PAPQ, but the priority P is
calculated according to the formula P = (A + B*T)/L where L is the length of the
document to be printed (in pages). In this way the priority of each job when
joining the queue is A/L, i.e. shorter jobs are given preference, but the* priority of all
jobs increases in time (although the rate of increase depends again on job size L).

Your task:

Consider the spooling system with a printer capable of printing 40 pages per
minute. The average print job is 4 pages long (assume Poisson distribution
here). It is obvious that the print system is capable of servicing the print
requests provided that they are less frequent than 10 per minute (Why?).

Write a brief program in Java to simulate the behavior of that spooling system
under the following scenarios:

1. FIFO: Plot the average turnaround time and the maximum turnaround time as a function of the print request frequency.

NOTE: Turnaround Time is the time elapsed between the moment the PRINT request
is issued and the moment the requested print job is completed.

2. SPJF: Plot the average turnaround time and the maximum turnaround time as
functions of the print request frequency.

3. PAPQ: Plot the average turnaround time and the maximum turnaround time as
function of the print request frequency, for selected values of parameters A and B.
The values of A to be considered are 0, 1, 2, and 4. The values of B are 1, 2, and 4.
Organize your plots in suitable groups.

4. LBAQ: Plot the average turnaround time and the maximum turnaround time as
function of the print request frequency, for selected values of parameters A and B.
The values of A to be considered are 0, 1, 2, and 4. The values of B are 1, 2, and 4.
Organize your plots in suitable groups.

You don't have to do the whole plotting crap, heh I didn't even bother with it cos I hate math but when I Got this I wrote the actual spooler simulation code and all the data structures for it.


The current time is 05:15 AM (GMT)

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.