Assigned Friday, Jan. 30, 2009, due Friday, Feb. 6, 2009
Midterm Friday February 6, 2009, closed book, closed notes.
Written Problems
[1] In this course we are building an application that uses numerical methods to solve differential equations and display the solutions to a user. These methods are used because they work for very general types of differential equations. However, if one restricts the types of differential equations that a user can specify it's possible to create an application that uses "analytical" techniques (methods that you learned about in Math 33B) to solve the differential equations. In this problem you will be creating a class structure that enables one to create applications that use an "analytic" technique to solve nth order, linear, homogeneous, constant coefficient differential equations. The analytic solution technique is that described on the sheet "Problem [1] background information".
[a] Give a class description (indicating data members and member functions) for a class that represents an nth order, linear, homogeneous, constant coefficient differential equation. Your class description may include associations to other classes.
[b] Give a class description (indicating data members and member functions) for a polynomial function class that possesses the functionality required by an application that will use the analytic solution procedure to construct solutions of the differential equation. Your class description may include associations to other classes.
[c] Give a class description (indicating data members and member functions) for a matrix class that possess the functionality required by an application that will use the analytic solution procedure to construct solutions of the differential equation. Your class description may include associations to other classes.
[d] Give a class diagram that would enable you to create a console program that allows a user to specify an nth order linear, constant coefficient, homogenous, ODE and display the results. In addition to the classes you identified in [1][a]-[c], you may (and should) introduce additional classes.
[2] True or False
(a) _____Class diagrams indicate the computations within a system.
(b) _____When you assign a derived class pointer to a base class pointer, you can access the derived class's member functions using that base class pointer.
(c) _____If a member function of a derived class overrides a base class member function for which the keyword virtual is not specified, then the derived class will not compile.
(d) _____The location of header files incorporated with the #include pre-processor directive can be specified by setting the include file path.
![]()
[3] Short Answer :
(a) Why isn't a listing of C++ class declarations equivalent to a class diagram?
(b) One has to make choices when implementing associations in C++. Often one must choose between creating an ordinary association or a composite association.
Computational Work
[Discussion/Preliminaries] The point of this assignment is to familiarize you with the build process that's required when you are using the Qt software from Trolltech for developing user interfaces. In Math 157 we will be using the "open source" version of Qt. This version is not completely integrated into the Visual Studio Integrated Development Environment (IDE) and thus requires a bit of extra effort to use. However, because we are using the open source version, the instructions and procedures described in the class will be the same as the instructions and procedures you will follow if you install the open-source version of Qt on your own computer. Notes concerning the installation of Qt and a link to a cached copy of the Qt source code will be made available on the Math 157 course announcements page.
To do this assignment you will need to download the QtConsoleGraphics repository from https://www.math.ucla.edu/~anderson/157support/ . To use these files, you will need to be on a machine where Qt has been installed. Currently, Qt is only installed on the machines in the back part of the PIC lab. You can tell if Qt is installed by opening up a command prompt window and just typing "assistant". This will bring up the Qt documentation browser.
(a) Build and run the test program using the Qt development tools
qmake -projectqmakenmake![]()
(b) Rebuild the test program using the QtConsoleGraphics packaged into a library
qmake -project -t lib "CONFIG += staticlib" qmakenmake QtConsoleGraphics.lib in the debug subdirectory of QtConsoleGraphics.qmake -project ..\QtConsoleGraphics you would add the linesINCLUDEPATH += ..\QtConsoleGraphics
LIBS += -L..\QtConsoleGraphics\debug -lQtConsoleGraphics nmake to build the programmake to build executables and libraries. Linux/Unix builds do not place executables and constructed libraries in a debug or release subdirectory. Also, when one builds a static library using Linux/Unix it is given the ".a" extension, so when hunting for the location of the QtConsoleGraphics library file (in order to specify it in the .pro file), look for a file called QtConsoleGraphics.a.