11.7 Exercises


11.7 Exercises

  1. Explain the difference between the class diagram and the object diagram. What are the similarities?

  2. Explain the differences and similarities between the collaboration diagram and the sequence diagram.

  3. Construct more detailed and complete UML diagrams (static and dynamic modeling) for the movies rental problem. This application must control the inventory of movies in a movie rental shop.

  4. Construct the relevant UML diagrams (static and dynamic modeling) for the problem of the child playing with two balls. Explain the diagrams used in this application.

  5. Construct the relevant UML diagrams (static and dynamic modeling) of a program that reads rainfall data in inches for yearly quarters, for the last five years. The program should compute the average rainfall per quarter (for the last five years), the average rainfall per year, and the maximum rainfall per quarter and for each year.

  6. Construct the relevant UML diagrams (static and dynamic modeling) of a program that calculates the volume of several spheres. For each sphere, the program should compute the volume. Before termination, the program should compute and display the average volume for all the spheres. After computing the volume of a sphere, the program asks the user if he wants to continue.

  7. Construct the relevant UML diagrams (static and dynamic modeling) of a program that reads data for every inventory item code and calculates the total value (in dollars) for the item code. The program also calculates the grand total inventory value. The number of inventory data to read is not known, so the program should continue reading data until the user replies that there are no more inventory items to process. Every item includes item code, item description, the number of items of that code in stock, and the unit value.

  8. Consider an automobile rental office. A customer can rent an automobile for a number of days and with a finite number of miles (or kilometers). Identify the type and number of objects involved. For every type of object, list the properties and operations. Construct static and dynamic modeling diagrams for this problem.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net