Sie sind auf Seite 1von 5

CLASS TEST:

ACADEMIC SESSION 2010/11

Campus School Department Level TITLE OF PAPER COURSE CODE Date and Time Duration

Maritime Greenwich Computing and Mathematical Sciences Computer Science Two Application Development for Mobile Devices COMP 1550 November 2010 1 hour 30 minutes (+10 minutes reading time)

Answer ALL questions. Question 1 carries 56 marks and question 2 carries 44 marks.

Question1 I. Natural Distros is an independent scientist team, which carries out missions in places where physical disasters occur (earthquakes, fires, volcanoes, etc). Natural Distros job is to inspect the area that the physical disaster took place and report to their employer (usually Government). During inspection, a variety of checks is applied and all the information is recorded on paper. As a second step, the information is passed manually onaWebForm. The team has decided to replace the paper report with a mobile application which can speeduptheprocessandsendtheinformationbackinsortoflivecommunication. You have been employed by Natural Distros to develop the application in Java ME. Discuss how the communication between the mobile application and the web application could be implemented. Identify issues that the developer would need to considerwhenimplementingthenetworkingfunctionalityoftheapplication. II. [25marks]

Usually more than two inspectors have to collaborate in order measure all parameters of the disaster. At the end of their inspection they have should be able to exchange informationandsynchronizetheirdata. a. Whichtechnologywouldyourecommendforthis? [5marks] b. Describe your chosen technology in terms of advantages/ disadvantages and howisitsupportedbyJavaMe. [11marks]

III.

Canyourapplicationbedevelopedasafatclientorthinclient?(Circletherightanswer) a. Fatclient b. Thinclient c. Neither d. Either [5marks] Brieflyjustifyyourchoice. [10marks]

Question2 AsafirstdraftfortheJavaMIDletdiscussedabove,thefollowingcodewasproduced(line numbershavebeenaddedforyourconvenience). 1.packagevolcanoPackage; 2.importjavax.microedition.midlet.*; 3.importjavax.microedition.lcdui.*; 4.publicclassVolcanoMidletextendsMIDletimplementsCommandListener{ 5.privateDisplaymDisplay; 6.privateString[]situation={"Severe","Mild","UnderControl"}; 7.privateTextFieldtxtInspectorName; 8.privateFormmMain; 9.privateChoiceGroupchSituationStatus; 10.privateAlertsevereAlert,mildAlert,okAlert; 11.publicVolcanoMidlet(){ 12.mMain=newForm("VolcanoApp"); 13.mMain.addCommand(newCommand("Exit",Command.EXIT,0)); 14.mMain.addCommand(newCommand("CheckStatus",Command.SCREEN,1)); 15.txtInspectorName=newTextField("EnterInspector'sName:","",20,TextField.ANY); 16.mMain.append(txtInspectorName); 17.chSituationStatus=newChoiceGroup("CriticalStatus",Choice.EXCLUSIVE,situation,null); 18.mMain.append(chSituationStatus); 19.mMain.setCommandListener(this); 20.severeAlert=newAlert("Severe"); 21.mildAlert=newAlert("Mild"); 22.okAlert=newAlert("Ok"); 23.}

24.publicvoidstartApp(){ 25.mDisplay=Display.getDisplay(this); 26.mDisplay.setCurrent(mMain); 27.} 28.publicvoidcommandAction(Commandc,Displayabled){ 29.if(c.getLabel().equals("Exit")){ 30.notifyDestroyed(); 31.} 32.else{ 33.checkSituation(); 34.} 35.} 36.privatevoidcheckSituation(){ 37.//Youwillcompletethecodehere.Seefollowingquestions 38.} 39.publicvoidpauseApp(){ 40.} 41.publicvoiddestroyApp(booleanunconditional){ 42.} 43.} I)Explainthefollowinglinesofcodefromtheclassabove: a. b. c. d. Line6 Line18 Line19 Line22

[20marks]

II)WritethecodeforcheckSituation().Itshouldcheckthestatusofthesituationenteredanddo thefollowing: IfthesituationisSevere,displaythesevereAlertforonesecond.Onthealertitshould say:Inspector[nameenteredintxtInspectorName],declaresstatus:[statusenteredin chSituationStatus]. IfthesituationisMild,displaythemildAlertforonesecond.Onthealertitshouldsay: Inspector[nameenteredintxtInspectorName],declaresstatus:[statusenteredin chSituationStatus]. Finally,ifthesituationisOk,displaytheokAlertforonesecond.Onthealertitshould say:Inspector[nameenteredintxtInspectorName],declaresstatus:[statusenteredin chSituationStatus]. [24marks]

Das könnte Ihnen auch gefallen