Académique Documents
Professionnel Documents
Culture Documents
Zara Tariq
Demo Lecture #01
Programmer
B love
working with
OOP.
Programmer
A only work
with PP.
Program Specs:
- Rotate 360 degree
- Play sound
+ SHAPES
+ USERS
HAVE
+ SOUND LIBRARY
+ CLICKING EVENT
NEW SPECS:
- Add New Shape – AMOEBA
- On user click,
- - Shape rotate to 360 degree
- - Play .mp3 sound file.
Implemented Required
Zara Tariq-2019 PAF-KIET 11
Programmer A (PP) Programmer B (OOP)
Square
Rotate(shapeNum) Rotate()
{
Circle
// if the shape is not amoeba,
{
//calculate the center point and rotate // make theTriangle
Rotate() square rotate 360
//else // degree
{ Amoeba
// use the xPt and yPt as the rotation point} // make Rotate()
the circle{ rotate 360
}
//offset and then rotate Which approach is// more
{
// degree
make the
Int xpt,ypt;
triangle rotate 360
efficient?
playsound()
} Public:
{ // degree
Rotate()
Changing 1 class OR { sound
playsound(shapeNum) }
{
// play the square
playsound() WAV
Programmer B
explains that these
are classes and not
procedure and he
did no duplications