Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
DevEnv U3 Solutions

DevEnv U3 Solutions

Ratings: (0)|Views: 2 |Likes:

More info:

Published by: Malcador El Sigilita on Aug 14, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Unit 3 - Activities
Activity 1 (Nasser González)
Do you think OOP is better than non-OOP? Why? If you think it is not, give anexample of a case where non-OOP is better than OOP.
Depends of the case. For shorts programs that do not have a lot of code, the non-OOPlanguage will be better, because you do not have to define a lot of objects and classes. Thischange when you have to design a more extends and complicated programs with more code.In this cases, it is better the OOP programing language because allows you design some codeand thanks to properties like heritage, do not waste a lot of time copying the same code fordifferent objects.
 Activity 2 (Manuel Vicente Pastor)
2. Do you think that OOP is a good choice when you have tocoordinate a large number of developers? Why?
The OOP is a very good choice when you have to coordinate a large number of developers, since these methods, it is very easy coordinate developers. In the OOPdevelopment we will have different types of objects, and the data and procedures areseparate and unrelated. This method makes it possible to developers be independent oneach other. The developers of a unit do not have to know what is going on in the otherunits.
 Activity 3 (José Ricardo Sepulcre)
3. Look for examples of classes in C#, Java and Python. Copy the code and try tofigure out the attributes and the methods.
 Example of class in C#:using System;public class myCalc{private int result;public myCalc(){result = 0;}public myCalc(int x){result = x;}~myCalc(){result = 0;}public void displayResult(){
Console.WriteLine("Result = {0}", result);}public void add(int x){result = result + x;}public void subtract(int x){result = result – x;}}Methods: myCalc(), myCalc(int x), displayResult(), add(int x), substract(int x)Attributes: resultExample of class in Java:public class JavaClassExample{private String name;public void setName(String n){name = n;}public String getName(){return name;}public static void main(String args[]){JavaClassExample javaClassExample = new JavaClassExample(); javaClassExample.setName("Visitor");System.out.println("Hello " + javaClassExample.getName());}}Methods: setName(String n), getName()Attributes: nameExample of class in Phyton:class Reverse:def __init__(self, data):self.data = dataself.index = len(data)def __iter__(self):return self def next(self):if self.index == 0:raise StopIterationself.index = self.index - 1return self.data[self.index]Methods: __init__(self, data), __iter__ (self), next (self)Attributes: data, index
 Activity 4 (Pedro Muñoz)
4.Imagine you have to develop a football manager application, where you keep trackof football clubs, players, staff and matches. You may add anything you want, if you think you need it. Using an OOP design, explain what classes you will have(including attributes and methods) and how they will be related to each other (if there is inheritance). (Note: if you don't like the subject, "football manager", feelfree to choose another one with approximately the same number of classes).
 Activity 5 (Javier Volpe)
5. In your application design, you agree with your colleagues that you needthese classes: music album, musician, movie, actor, book, writer. Figure out someattributes and methods for each one, and if you think you will need more classes,add them and justify it.
* The ones the statement ask for are in italic, the new ones in normal type.*Class: MusicAlbum Attributes: Title, Year, # of songs, PrizesMethods: getTitle(), getYear(), getSongs(), getPrize()

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->