Assignment 2, due Sep 1
Part of
the homework for CS:2820, Fall 2017
|
Assignments are to be turned in on paper. On every assignment, write your name, course and section number at the top. Write your name as it appears in your university records! Use the section number for which you are registered! We will not do detective work to figure out who did what. Work must be legible. Homework is due on paper in discussion section, usually at the start except when the assignment indicates that time to work on the assignment will be provided in class. Exceptions will be made only by advance arrangement with your TA (excepting "acts of God" outside your control). Never push homework under someone's door!
Background: Consider these two Java declarations:
int i = 1 + 'a'; String j = "a" + 1;
a) What operation does the + operator do on the first line? (0.3 points)
b) What is the resulting value of i? (0.2 points)
c) What operation does the + operator do on the second line. (0.3 points)
d) What is the resulting value of j? (0.2 points)
a) Give the truth table for the 2-input function called a or not b. (0.3 points)
b) What is the function number of the function in part a in the table of 16 functions. (0.2 points)
c) Give the truth table for the 2-input function called a and not b. (0.3 points)
d) What is the function number of the function in part c in the table of 16 functions. (0.2 points)
Consider the problem of modeling the University of Iowa pentacrest, with these streets if we ignore the complexity of the bus interchange:
These streets also play a part, some only because they add intersections to the model:
Wherever 2 lanes go the same direction between intersections, lane changes are allowed.
A problem: Draw a diagram, with points for every intersection and arrows connecting the points showing how this road network would be modeled. Include both real intersections and the intermediate intersections that must be added in order to model lane changes. The arrow head on each "road" indicates the direction of travel on that road.
Legibility matters. Lay out your diagram with north on the top and try to keep the topology the same as the real road network. Exact scale does not matter, but You might start by using a blow-up of a map as a layout guide (there are plenty of on-line map services). If your drawing skills are horrible, you may have to redraw a few times to get legible results.