Sunteți pe pagina 1din 3

ProgramacindeComputadoresII27135TallerN2

UniversidadIndustrialdeSantander
EscueladeIngenierasElctrica,ElectrnicaydeTelecomunicaciones
NOMBRE:___________________________________CDIGO:__________
GRUPO:_____FECHA:________NOTA:_____
1. Createalistusingthefunctionrangewiththenumbersfrom1to100.Thenwriteafilewith
100lines,whereeachlinehasanumberfromthelist(couldberandom).

2. Createadictionarywiththeenglishmusicalnotessystem(C,D,E,F,G,A,B)askeys,andthe
spanishsystem(Do,Re,Mi,Fa,Sol,La,Si,Do)asvalues.Then,printeachdictionaryitem.
Thedictionarycanbetraversewithaforloop.

3. Drawtheflowdiagramofafunctionthattakesalistandprintindexandelementofthelist.
Writeascriptwiththefollowingsections:Definitionofthefunction,getinformationforthe
userandcallbackofthefunction.

4. Drawtheflowdiagramofafunctionthattakesatupleandprintindexandelementofthe
tuple.Writeascriptwiththefollowingsections:Definitionofthefunction,getinformationfor
theuserandcallbackofthefunction.

5. Drawtheflowdiagramofafunctionthattakesadictionaryandprinteachitem(pairkey
value)ofthedictionary.Writeascriptwiththefollowingsections:Definitionofthefunction,
getinformationfortheuserandcallbackofthefunction.

6. Drawtheflowdiagramofafunctionthattakessixparameters:Student'sname,student's
codeandfourgradesandcomputestheaverageofthestudent.Writeascriptthatuseslists
tosolvetheproblem.Thescriptmusthavethefollowingsections:Definitionofthefunction,
getinformationfortheuserandcallbackofthefunction.

7. Drawtheflowdiagramofafunctionthattakesalistandprinteachelementofthelistin
reverseorder.Writeascriptwiththefollowingsections:Definitionofthefunction,get
informationfortheuserandcallbackofthefunction.

ProgramacindeComputadoresII27135TallerN2
UniversidadIndustrialdeSantander
EscueladeIngenierasElctrica,ElectrnicaydeTelecomunicaciones
NOMBRE:___________________________________CDIGO:__________
GRUPO:_____FECHA:________NOTA:_____
8. Createaclassthatcontructobjectstorepresentanelectrodomestic.Theclassmusthavethe
method__init__,__str__andmethodstoturnon,turnoff,andbreakdown.Callbackthe
classtoconstructfiveobjects:Fridge,television,radio,microwaveovenandwashing
machine.Note:Asktheprofessoraboutthemethodsturnon,turnoffandbreakdown:P

9. Makeanewclassthatinheritthemethodandattributesoftheclasselectrodomestic,to
representmeansoftransport.Createsomeobjectssuchas:Bus,car,bike,train,truck,
airplane,vessel,etc.Drawtheclassandobjectdiagram.

10. Drawtheflowdiagramofafunctionthattakesthenameofafileandopenthefilestring
andprinteachwordofthefile.Writeascriptwiththefollowingsections:Definitionofthe
function,getinformationfortheuserandcallbackofthefunction.

11. DevelopaprogramwithapproachOOPtoreadaDNAsequenceandfindthecomplementary
sequenceaccordingtothefollowingrulesintable1.Additionalytheprogramwillshowthe
aminoacidssequence,andwillrecognizeaminimumofthreecodons(seetable2).Incaseof
findingotherscodonstheDNAsequencewillbereplacedbyahyphen.Forthisexercise
youmusttocreateadnaclassandtwomethods(complementary,aminoacids).
Leadernucleotide

Complement

Adenine(A)

Thymine(T)

Cytosine(C)

Guanine(G)

Thymine(T)

Adenine(A)

Guanine(G)

Cytosine(C)

Table1.Nucleotidescomplements.

ProgramacindeComputadoresII27135TallerN2
UniversidadIndustrialdeSantander
EscueladeIngenierasElctrica,ElectrnicaydeTelecomunicaciones
NOMBRE:___________________________________CDIGO:__________
GRUPO:_____FECHA:________NOTA:_____
Codon

Aminoacid

GAA

GlutamAcid(E)

TTC

Phenylalanine(F)

CCA

Proline(P)

Table2.Codonsandaminoacidrelationship.
Examplesofexitoftheprogram:
Originalsequence:ATCGAAAATTTCCCA
Thisisthecomplementarysequence:TAGCTTTTAAAGGGT
Theaminoacidssequenceis:EFP

12. Write a function that read the file cars.csv and create one dictionary with items
{(model):bestprice}.TocalculatethebestpriceyouhavetocreateaclassnamedCars.The
classmusthave3methods;__init__,__str__,andcomparison.Drawtheobjectandclass
diagram.

S-ar putea să vă placă și