1. (24) Suppose you are automating operations for a store selling PCs. All PCs of a certain model number are equivalent as far as buyers are concerned, but the store wants to sell them in FIFO (first-in, first-out) order so that no box gets too worn-looking. Each PC has a model number (int), serial number (10-char string), vendor id (int), and delivery date (int day number.)
2. (14) In the same scenario as problem 1, once a PC is sold, we need to keep track of the customer for each individual PC. Each PC has a unique customer but a single customer can purchase multiple PCs. Each customer has a string name and a customer id, custid (a unique integer).
3. (24) Web Background
4. (14) Maven and command line tools.
a. Consider two copies of the same Maven project, in top-level directories dir1 and dir2. After "mvn package" has been executed in the first copy, "mvn package" executes for the second copy without any downloads of jar files. Explain why.
b. Suppose a Maven project has one JUnit test that fails, but the main sources are fine (the problem is only in the unit test). What will happen when "mvn package" is executed? Will this command succeed? Explain why or why not.
c. Consider JdbcCheckup.java. Suppose your current directory is your own jdbc directory on pe07 containing JdbcCheckup.java and the driver jar files, previously copied from /data/htdocs/cs636/jdbc. Give the command to compile JdbcCheckup.java, and then the command to run it to connect to Oracle on dbs3. You don't need to show how to enter information into the running program.
5. (24) System implementation. In pizza1 consider the service method listed here:
// return all orders for this
room, for today, in order by id
public List<PizzaOrderData>
getOrderStatus(int roomNumber) throws ServiceException {
List<PizzaOrder>
pizzaOrders = null;
List<PizzaOrderData>
pizzaOrders1 = new ArrayList<PizzaOrderData>();
try {
pizzaOrders =
pizzaOrderDAO.findOrdersByRoom(roomNumber,
adminDAO.findCurrentDay());
for
(PizzaOrder order: pizzaOrders) {
pizzaOrders1.add(new PizzaOrderData(order));
}
} catch (SQLException e) {
throw new
ServiceException("Error in getting status" + e, e);
}
return pizzaOrders1;
}