Posted : Friday September 9
Due : Monday September 19, noon
You must do this assignment INDIVIDUALLY and follow all the directions in the course lab manual, available on the course web page, regarding assignment submission. Marks will be deducted if you do not follow these directions. Assignments must be submitted electronically via the Virtual Campus.
Your algorithms must be developed using the format seen in class, and you should not use any structures (for example, loops or branches) that have not yet been covered in the lectures.
Answer the following questions. You should be able to find the answers by consulting the course web pages, the SITE introductory lab guide, and the university’s web site. Remember to acknowledge your sources!
a)
According to the ITI 1220 policy on plagiarism,
what sorts of things can you discuss with your colleagues and classmates? Should you take notes of such
discussions?
b)
According to the User Code of Conduct for
Computing Resources, what are you required to ensure about the use of your
account and computing resources?
c)
In the Undergraduate Studies Calendar, the
regulations regarding Academic Fraud contain a list of sanctions that may be
applied to a student when academic fraud is committed or attempted. What are the
first three sanctions on the list?
d) If you see a problem with a Relmon laser printer, and you believe the problem is within SITE, to what e-mail address should you send a message describing the problem?
Using the uOttawa webmail system, send an e-mail to the Teaching Assistant for your lab section, who is listed on the web page at http://www.site.uottawa.ca/~awilliam/iti1220/Schedule.html.
The e-mail message that you send should contain the following
information:
This question has some exceptional procedures:
Save a copy of the file “Template for ITI 1220 programs.” This file is available from the virtual campus. Modify this file so that the identification information is correct for you, and that it is for Assignment 1, Question 3. (Note that this information is in two places; be sure to modify the file in all necessary locations.) After you have made the changes, submit the revised file as part of your assignment. As per the general assignment instructions, the file name should be A1Q3.java.
Note: You do not have to compile the file (although you can if you wish), nor do you need to submit a file A1Q3.class in this specific case.
After a long session of programming in the SITE labs, one naturally wants to return home as quickly as possible. Suppose that there are two options to travel from the SITE building to where you live, both of which follow the same route.
1. You can walk the entire distance.
2. You can ride one bus for most of the trip, but you still have to walk to and from the nearest bus stop at each end of the trip, and there is a waiting time for the bus to arrive.
Design an algorithm that will compute the time it will take to travel home for both of walking and taking the bus, taking into account the following:
[Sources: OC
Transpo’s “Trip Planner” and route #1 schedule, Google
maps]
Be careful to fully describe the algorithm, as to what values are given, what the algorithm's results are, and what assumptions and constraints there are on the algorithm.
Recently, the media has been asking engineers for an estimate of how long it will take to drain the water from the city of New Orleans after the floods resulting from hurricane Katrina. This is an extremely complex problem with a large number of variables with uncertain values, and it is a challenge to provide an accurate estimate.
Even before hurricane Katrina, it was necessary to have pumps to remove rainfall from New Orleans. Some areas of the city are up to 3 metres below sea level and water would accumulate at the low points during prolonged periods of rain. In this question we will look at a much simpler situation than what New Orleans was facing even in “normal” rain situations, and assuming that there is no flooding from breaks in the levees that protect the city from Lake Pontchartrain and the Mississippi River.
Suppose that you have a rectangular area that needs to be drained during a period of rain. You have pumps with a rated removal capacity. The pumps are not started until a specific number of millimetres of rain have fallen. However, as the pumps are running, it continues to rain with a constant rate of accumulation.
It has been decided that it is desirable to be able to completely remove water from the area within 2 hours after the pumping systems are started.
Design an algorithm to calculate the pumping capacity required to remove rain in 2 hours for a specified area specified by length and width dimensions, and for specified prior rainfall accumulation and rate.
Be sure to account for the following:
· The area to be drained has length and width dimensions measured in metres
· The previous rainfall accumulation is measured in millimetres
· Rainfall rate is measured in millimetres per hour
· Pumping capacity is measured in litres per hour
For example: Suppose that you have an area that is 3 metres by 5 metres, and rain has already accumulated to a height of 6 millimetres. The rate of rain is 2 millimetres per hour. The algorithm would return the value 75 litres per hour as the pump capacity that is needed.
It may be useful to remember that one litre represents a volume of water that is a cube with sides of 100 millimetres.