Wednesday, July 20, 2011

Written Prelim Exam

Prelim exam will be on July 31, 2011. 3:00PM-5:00PM. Sunday.

The coverage for the exam will be the following:

- Stack and Queues
- plus Inheritance
- plus Polymoprhism

Note:
Bring your own yellow paper, books, slides and other form of notes. No borrowing of resources.

If you have some questions, do not hesitate to ask me.

Final Project - Interactive Expression Evaluator

To all sections:

[Download Project Case Study]

Your partner for the final project is the same with your partner I assigned to you. See your partner.

Your final project is to complete the Interactive Expression Evaluator. Complete the missing functions and methods and implement the graphing program.


On the day of submission bring the following:
1. Laptop
2. Hard-copy of your source code
3. Presentation of your project (PowerPoint)

Requirements of the defense:
-Working solution.
-Original source code.

The project presentation/defense will be held one week before the final exam.

Take Home Prelim Exam

To all sections:

-Take home prelim problem exercise with a follow up defense next week (July 26, 27).
-This will serves as 40% of your prelim grade.
-Grading will be based on your answers and the correctness of your solution.
-A group of two.

On the day of submission bring the following:
1. Laptop
2. Hard-copy of your source code

Requirements of the defense:
-Working solution.
-Original source code.

PROBLEM:

Parsing Arithmetic Expressions

This problem involves the usage of Stack and Queue.

This application is parsing (that is, analyzing) arithmetic expressions like 2+3 or 2*(3+4) or ((2+4)*7)+3*(9–5), and the storage structure it uses is the stack.

It's easier for the algorithm to use a two-step process:  

   1.    Transform the arithmetic expression into a different format, called postfix notation.  
   2.    Evaluate the postfix expression.  

Step 1 is a bit involved, but step 2 is easy. In any case, this two-step approach results in a simpler algorithm than trying to parse the arithmetic expression directly.

-----

Groupings

Agal:

ABREU, Chester Duane G.
AMANTIAD, Jan Rhais L.

Cacs:
CABILI, SHERWIN A.
CANO, Rommel John S.

Depo:
DUMORAN, Gel Dante E.
PAYLAGA, Jon Paolo J.

Saac:
SUDARIA, CYRUS ALLAN C.
AMBOLODE, Von Michael C.

Agam:
ANDAYA, Princess Cecile G.
Araña, Dale Brian M.

Acea:
ARCAMO, Anthea Izza C.
ECHAVEZ, Marie Beth A.

Esen:
EDAROS, NAIDA S.
FABRICANTE, Zarah Mae N.

Lemo:
LEOPOLDO, June Karl P.
MERCADO, Nel Ian O.

Mopa:
MODEQUILLO, Charles Mathius M.
PONCE, April Rose A.

Resad:
RABE, ANGELA PEARL E.
SALOMSON, Ederlina D.

Sate:
SY, Chrissan G.
TAMSE, Lady Jane G.

Usel:
UMPA, Al-Mohajerani S.
ENRIQUEZ, John Daniel


Asal:
ADRAQUE, Honey Grace S.
APAL, Joren Ezra L.

Bocas:
BONCALES, Ergelie L.
CANOY, Juñel S.

Jeam:
JERUSALEM, JAYSON A.
MALALES, Vincent Q.

Miquiem:
MILA, VERCILLIUS JR. A.
Quiamco, Thor Wendel M.

Sebs:
SERATE, Silver Gems B.
SUMINGUIT, Dexter Lyn M.

Tab:
TALABA, Mark Sunday C.
APAS, CARLO JOEL B.

Baba:
BAGUIO, Kristopher Joseph C.
BASHER, HANAN T.

Saturday, July 16, 2011

Assignment: Stack & Project Proposal

Download the slide.

Study the Stack class.
Experiment the applications of stack that were presented  in the class.
Submit a written report that also includes your output (printscreen of the window) next meeting.
Research what are the other applications that also uses stack.
Submit a project proposal next meeting. Please refer to your syllabus that can be also downloaded in the site.

Thursday, July 7, 2011

Laboratory II: Graphics System

Note:  This machine problem needs an understanding of inheritance and polymorphism. For a clearer problem definition please refer to page 659 of the book given by Mr. Sy in our Facebook group.
Deadline: Thursday, July, 14, 2011. NO EXTENSION. NO WORK IN THE LAB, NO SCORE (0).

1. Consider a graphics system that has classes for various figures, say rectangles, squares, triangles, circles, and so on. For example, a rectangle might have data members height, width, and center point, while a square and circle might have only a center point and an edge length or radius, respectively. In a well-designed system these would be derived from a common class, Figure. You are to implement such a system. The class Figure is the base class. You should add only Rectangle and Triangle classes derived from Figure. Each class has stubs for member functions erase and draw. Each of these member functions outputs a message telling what function has been called and what the class of the calling object is. Since these are just stubs, they do nothing more than output this message. The member function center calls erase and draw to erase and redraw the figure at the center. Because you have only stubs for erase and draw, center will not do any “centering” but will call the member functions erase and draw. Also, add an output message in the member function center that announces that center is being called. The member functions should take no arguments. There are three parts to this project:
a. Do the class definitions using no virtual functions. Compile and test.
b. Make the base class member functions virtual. Compile and test.
c. Explain the difference in results.
For a real example, you would have to replace the definition of each of these member functions with code to do the actual drawing. You will be asked to do this in Programming Project 2.
Use the following main function for all testing:
//This program tests Programming Problem 1.
#include <iostream>
#include "figure.h"
#include "rectangle.h"
#include "triangle.h"
using std::cout;
int main( )
{
    Triangle tri;
    tri.draw( );
    cout <<
      "\nDerived class Triangle object calling center( ).\n";
    tri.center( ); //Calls draw and center
    Rectangle rect;
    rect.draw( );
    cout <<
      "\nDerived class Rectangle object calling center().\n";
    rect.center( ); //Calls draw and center
    return 0;
}
2. Flesh out Programming Problem 1. Give new definitions for the various constructors and
member functions Figure::center, Figure::draw, Figure::erase, Triangle::draw, Triangle::erase, Rectangle::draw and Rectangle::erase so that the draw functions actually draw figures on the screen by placing the character ’*’ at suitable locations on the screen. For the erase functions, you can simply clear the screen (by outputting
blank lines or by doing something more sophisticated). There are a lot of details in this and
you will have to decide on some of them on your own.