TaskDetails:You are requiredtocomplete5 practicalexercises in Javathat coversmaintopicsinyour outline. This is individual assignment.Thecut-offsubmission dateand timefor practical assignmentwill be 11pmon Sunday oftheweek10. All javafileswill be neededtobe savedin asingle folder namedas StudentID andNameto be submittedas single.zipfile on courseMoodlepage.

Assessment topic: Java applications

Description:This is practical assignment coveringprogramming concepts taughtfromweek1 – 9. You should submitallyour class fileonMoodle with .javaextensionina single Zip/rar folder.

Question1: Java Fundamentals (5points)

Youareorganising a 21stbirthdaypartyforyour best friend.Youhave booked a venueatDarlingHarbour thatwill charge$60per guest. The venuewill alsochargeyoua $200fee ifthereareless than 40guests.

You invite 50people tothebirthdayparty.37 people tellyou they areplanningto attendand 5peopletell you they cannotattendtheparty.

Writeaprogramthat displaysthe following information:

*Thenumber ofpeople who havenotyet toldyou iftheycanattendthe party.

* Thenumber ofpeople that needto adviseyou theycan attend,so thatyoudon’tneedtopaytheextra $200 fee.

* Calculateand print the totalcost ofthepartygiventhe current number ofpeoplewhohavetoldyou they canattendthe party.

* Calculateand print the totalcost oftheparty ifallthepeoplewhohavenot replied totheparty invitation yet can come.

Question2:Nested loops (5 points)

At theparty,theDJ allows theguests tovote for their favourite songs,and thelast songofthe party is the most popular song.TheDJwill givea list of fivesongs toten random guests andaskthemto choose their favourite song.Thesongwhichreceives themost votes willbethemost popular song.Ifthere is more than one songwhich receives the most votes, then anyofthemost popular songs canbeplayedas thefinal song ofthenight.

Writeaprogramthatwill complete the following tasks:

*Show each ofthe10users user a list ofallthe fivesongs and askthemtochoose their favourite.

* Store thevotes for the songs in anarray,where thefirst element ofthearrayinthenumber ofvotes for thefirst song,and so on.

*Determine the most popular song.

* Print out themost popularsongandthenumber ofvotes for the most popular song. If more thanone song isvotedthemost popular, thenanyofthemmaybeprintedout.

Question3: 2DArrays (5points)

TheDJ for theparty needstocalculate some informationabout their planned song playlist for the party.

Writeaprogramto inputthenumber of minutes and the number ofseconds for each ofthe songs inthe planned song playlist. The programshould first ask for thenumber of songs intheplanned song playlist. Theprogram will askfor two numbers for each song,whichis thenumber ofminutes and the number of seconds. For example,a song thatplays for two minutes and30 seconds can beinputas 2 and30.

The programshould printoutthe total playingtimefor allthesongs,displayedasa number ofminutes and seconds. Remember there are 60 secondsinaminute.

Question4:Strings (5points)

Writeaprogramthat asks for twoparallel arraysofStringobjects. One ofthearrayswill hold thefirst names oftheguests, and the other arraywill hold the last names oftheguests.

The guestswillbeallocated tosit ata table atthe party.Some ofthe guests will be seated ata special birthdaytablewithyour friendwhose birthday you are celebrating. Thosewitha first namethat startswith thesame letteras thefirst name ofyour birthdayfriendwill be sittingat thespecialbirthdaytable.

Writeaprogramthatwill complete the following tasks:

* Askthe user for the number ofguests to beseated.

* Askfor thefirst nameofthepersonhavingthe birthday.

* Askthe user for thefirst and last names ofeachguest, and storethemintwoparallelarrays.

* Print out thenames ofthosesittingat the special birthdaytable. Printthe first names in lowercase, and thelast names inuppercase.

MarkingGuide:Studentswill be markedaccordingto the implementation ofthe basic concepts coveredin this subject.Some elementsareofcritical importance,andfailure toidentify and address theseproperly will resultin lowmarks.

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *