De Date: Fiday, Nov. 11, 2016 befoe 6:00pm. CSci 1103: Intodction to Java Homewok 6 Fa 2016 Instctions: This is an individa homewok assignment. Thee ae two pobem woth 20 points each. Sove the pobems beow by yosef (nike the abs, whee yo wok coaboativey), and sbmit the sotion as a Java soce code fie. Hee ae a few moe impotant detais: 1. Unike the compte ab execises, this is not a coaboative assignment. Yo mst design, impement, and test the sotion to each pobem on yo own withot the assistance of anyone othe than the cose instcto o TAs. In addition, yo may not incde sotions o potions of sotions obtained fom any soce othe than those povided in cass: exampes fom the textbook, ectes, o code yo and yo patne wite to sove ab pobems. Othewise obtaining o poviding sotions to any homewok pobems fo this cass is consideed academic miscondct. Ask the instcto if yo have qestions. 2. Becase a homewok assignments ae sbmitted and tested eectonicay, the foowing ae impotant: Yo foow any naming conventions mentioned in the homewok instctions. Yo sbmit the coect fie(s) thogh Moode by the de deadine. Yo foow the exampe inpt and otpt fomats given in each pobem desciption. Regadess of how o whee yo deveop yo sotions, yo pogams compie and execte on cseabs comptes nning the Linx opeating system. 3. The pobem desciptions wi say show at east one test case and the esting coect otpt. Howeve, yo shod test yo pogam on othe test cases (that yo make p) as we. Making p good test cases is a vaabe pogamming ski, and is pat of ensing yo code sotion is coect. Pobem A: Mini-maze (20 points) Make a sma 2D maze. Yo shod aow the se to move eft, ight p o down. The maze shod se the foowing symbos:. = Open space X = Yo O = Exit W = Wa If the se ties to move otsize of the maze o into a wa, they shod jst move nowhee. When the se eaches the exit, dispay the boad and end the game. Fo this sbmission, bid and sbmit the maze as shown in the exampes (i.e. do not change the ocation of was/exit/x).
Exampe 1 (se inpt is ndeined): d X....X....X.
.WXW WWXW O.X. OX.. X... Yo win! Test yo pogam sing not ony the exampe data above, bt othe cases as we. And evise yo pogam nti yo ae se it is coect. When yo ae done, name the soce code fie <sename>_6a.java. Hee yo epace <sename> with yo U of M emai addess (fist ette ppe case); fo exampe, if yo emai addess is smithx1234@mn.ed, yo fie shod be named Smithx1234_6A.java. Then sbmit yo pogam sing the HW6 Pobem A sbmission ink in Moode.
Pobem B: Gocey eceipt (20 points) Wite a pogam to geneate a eceipt when gocey shopping. To do this, the se shod be aowed to ente sentences indicating what they boght. When thee ae no moe items, yo shod ente! checkot (withot qotes) to stop the pogam. Yo shod then ist the qantities of each item boght, aong with the tota (do not incde the phase ). Yo pogam shod be case-insensitive. The capitaization yo shod dispay in the otpt is the fist way they enteed the wods (see exampes 2 & 3). Exampe 1 (se inpt is ndeined): appe appe banana mik Tota items: 4 appe x2 banana x1 mik x1 Exampe 2 (se inpt is ndeined): coke Coke COKE MORE COKE Tota items: 4 coke x3 MORE COKE x1 Exampe 3 (se inpt is ndeined): COKE COke Coke coke c... oke Tota items: 5 COKE x4 c... oke x1 Exampe 4 (se inpt is ndeined): pack of soda
pizza pizza cheese pizza pineappe appe Tota items: 6 pack of soda x1 pizza x2 cheese pizza x1 pineappe x1 appe x1 Exampe 5 (se inpt is ndeined): Tota items: 0 Test yo pogam sing not ony the exampe data above, bt othe cases as we. And evise yo pogam nti yo ae se it is coect. When yo ae done, name the soce code fie <sename>_6b.java. Hee yo epace <sename> with yo U of M emai addess (fist ette ppe case); fo exampe, if yo emai addess is smithx1234@mn.ed, yo fie shod be named Smithx1234_6B.java. Then sbmit yo pogam sing the HW6 Pobem B sbmission ink in Moode.