Microsoft Word - Assignment3- 1/5 - SCIT School of Computing and Information Technology Spring 2022 CSIT121  Programming Fundamentals Assignment 3 (10 marks) Due Time and Date: Due...

1 answer below »
question is attached in files. Please write the code based on the specification. If the document says don't use a specific type of component in java please do not use that. Thanks.


Microsoft Word - Assignment3 - 1/5 - SCIT School of Computing and Information Technology Spring 2022 CSIT121  Programming Fundamentals Assignment 3 (10 marks) Due Time and Date: Due by Saturday 22nd Oct 2022 11:30 pm General Requirements: • You should create your programs with good programming style and form using proper blank spaces, indentation and braces to make your code easy to read and understand. • You should create identifiers with sensible names. • You should make comments to describe your code segments where they are necessary for readers to understand what your code intends to achieve. • Please add the following header in your program: /*------------------------------------------------------ My name: My student number: My course code: CSIT121 My email address: Assignment number: 3 -------------------------------------------------------*/ Objectives This assignment requires you to design and implement a Graphic User Interface (GUI) for the customers and products Order System (OS) by using Java Swing. Meanwhile, the file I/O and exception handling shall be implemented in the assignment. Background You are required to design, implement, and test an ordering system with the Graphic User Interface (GUI). The program shall 1) Load customers’ data and products’ data when the program starts. 2) Display GUI to help a customer to make new orders. 3) Handle possible exceptions during the interaction between the customer and the system. 4) Save the customer orders to a text file. The UML class diagram of OS is given below. You can add new classes, methods and/or attributes in the UML class diagram but CAN NOT delete any existing classes, attributes, and methods. Your java implementation must be consistent with the UML class diagram. - 2/5 - A customers and products OS application initially loads data of customers and products from the text files. The format of a file customers.txt contains the data like ALFKI,Maria Anders,Obere Str. 57,030-0074321 ANATR,Ana Trujillo,Avda. de la Constituci¢n 2222,(5) 555-4729 ANTON,Antonio Moreno,Mataderos 2312,(5) 555-3932 Each row is a record of a customer. The fields of each customer consist of customer code, name, address, and phone number. Each field is separated by a character comma (,). - 3/5 - The format of a file products.txt contains the data like Alice Mutton,Pavlova Ltd.,Meat/Poultry,0,39.00 Aniseed Syrup,Exotic Liquids,Condiments,13,10.00 Boston Crab Meat,New England Seafood Cannery,Seafood,123,18.40 Camembert Pierrot,Gai paturage,Dairy Products,19,34.00 Each row is a record of a product. The fields of a product consist of product name, supplier name, category, stock quantity, and unit price. Each field is separated by a character comma (,). In this assignment, we can assume that the input text files are customers.txt and products.txt. The detailed requests are as follows: 1. Update your UML diagram You shall update the UML class diagram by adding a new GUI class (for a new order). You can add classes, methods, and attributes. Please make sure your implementation is consistent with your UML class diagram. 2. Design and implement a GUI. The OrderSystem class shall contain Swing components, such as JFrame, JPanel, JLabel, JTextField, JButton, JList, JTextArea, etc. With the GUI, a customer can complete the order of products. 3. Customer ordering After initialization, the GUI of customers and products OS will be displayed. If a customer is selected from a list, the details of the customer are displayed. The customer can start a new window when clicks a button New Order and place a new order of products. a. The new order number and order date are automatically generated. b. The order number start from 1 when there is no order in the container orders. The new order number is the size of the container orders plus 1. c. The order date is the current system date. 4. Order products The customer can start to order any products via the GUI. When the customer selects a new product from a list, the product’s details are displayed. a. The customer can click the button Order>> to place the product in the order list. The stock quantity of the product should be decreased by 1. Display the updated product details and order details. b. If the customer selects an ordered product, then clicks the button Unorder<, the product order quantity is decreased by 1. if the order quantity is 0, then the product is removed from the order list. display the updated product details and order details. c. if the customer clicks the button ok, the new order is stored in the container orders and quits the window. d. if the customer clicks the button cancel, quit the window without saving the new order. 5. save the order details when a customer clicks the button save order, all the order details are saved to a text file orders.txt. 6. exception handling - 4/5 - the system shall be able to handle the exceptions during the interaction between the customer and the system. the exceptions may include invalid information when loading customers and products. invalid data when a product is ordered. check the sample processing in a file assignment3_sampleprocessing.pdf and watch the demonstration video for more details. tasks task 1 (1 mark): update the uml class diagram based on the design given above. you are allowed to add new classes, more attributes, or more methods. task 2 (7 marks): implement the program according to the updated uml class diagram by using java. the program shall • be consistent with the uml class diagram; • design and implement the gui by using java swing. please make sure to use jframe, jpanel, jlabel, jtextfield, jbutton, jlist, jtextarea, etc. in your gui; • follow the conventions for naming all classes, variables, and methods, and provide sufficient comments; • be implemented by using the advanced oop features such as inheritance, polymorphism, abstraction, interface, and/or class downcasting. • be able to initialise the customers and products os; • be able to help the customer to complete the ordering via the gui; • be able to handle possible exceptions during the ordering process; • be able to view or modify the current order list via the gui; • be able to export the customer’s orders to a single text file. task 3 (2 marks): compilation and test.  please compile your program with ‘javac’ and carefully test your program for all the requests.  test your program to all cases in gui.  please do not define the package in your program (a special alert for students who use ide to complete the assignment). submission: • please submit your solution to moodle (assignment 3). email submission is not accepted. • please submit an individual pdf document (ordersystem.pdf) that contains your answers for task 1 and task 3. please include the updated uml class diagram for task 1. include the snapshots to clearly shows the compilation, and the execution of your program for task 2. you need to demonstrate all tasks with the gui. • please submit all java codes for task 2 and make sure the primary class’s name is ordersystem.java. please submit the text file orders.txt created by your program in the test. notes: enquiries about the marks can only be made within a maximum of 1 week after the assignment results are published. after 1 week the marks cannot be changed. mark deductions: compilation errors, incorrect result, program is not up to spec, poor comments, poor indentation, meaningless identifiers, required numeric constants are not defined, the program - 5/5 - uses approaches which have not been covered in the lectures. the deductions here are merely a guide. marks may also be deducted for other mistakes and poor practices. alfki,maria anders,obere str. 57,030-0074321 anatr,ana trujillo,avda. de la constituci¢n 2222,(5) 555-4729 anton,antonio moreno,mataderos 2312,(5) 555-3932 arout,thomas hardy,120 hanover sq.,(171) 555-7788 bergs,christina berglund,berguvsv„gen 8,0921-12 34 65 blaus,hanna moos,forsterstr. 57,0621-08460 blonp,frederique citeaux,24 place kleber,88.60.15.31 bolid,martin sommer,c/ araquil 67,(91) 555 22 82 bonap,laurence lebihan,12 rue des bouchers,91.24.45.40 bottm,elizabeth lincoln,23 tsawassen blvd.,(604) 555-4729 bsbev,victoria ashworth,fauntleroy circus,(171) 555-1212 cactu,patricio simpson,cerrito 333,(1) 135-5555 centc,francisco chang,sierras de granada 9993,(5) 555-3392 chops,yang wang,hauptstr. 29,0452-076545 commi,pedro afonso,av. dos lusiadas 23,(11) 555-7647 consh,elizabeth brown,berkeley gardens 12 brewery ,(171) 555-2282 dracd,sven ottlieb,walserweg 21,0241-039123 dumon,janine labrune,67 rue des cinquante otages,40.67.88.88 eastc,ann devon,35 king george,(171) 555-0297 ernsh,roland mendel,kirchgasse 6,7675-3425 famia,aria cruz,rua oros 92,(11) 555-9857 fissa,diego roel,c/ moralzarzal 86,(91) 555 94 44 folig,martine rance,184 chausse de tournai,20.16.10.16 folko,maria larsson,�kergatan 24,0695-34 67 21 frank,peter franken,berliner platz 43,089-0877310 franr,carine schmitt,54 rue royale,40.32.21.21 frans,paolo accorti,via monte bianco 34,011-4988260 furib,lino rodriguez,jardim das rosas n. 32,(1) 354-2534 galed,eduardo saavedra,rambla de catalu¤a 23,(93) 203 4560 godos,jose pedro freyre,c/ romero 33,(95) 555 82 82 gourl,andr‚ fonseca,av. brasil 442,(11) 555-9482 greal,howard snyder,2732 baker blvd.,(503) 555-7555 grosr,manuel pereira,5 ave. los palos grandes,(2) 283-2951 hanar,mario pontes,rua do paco 67,(21) 555-0091 hilaa,carlos hernandez,carrera 22 con ave. carlos soublette #8-35,(5) 555-1340 hungc,yoshi latimer,city center plaza 516 main st.,(503) 555-6874 hungo,patricia mckenna,8 johnstown road,2967 542 islat,helen bennett,garden house crowther way,(198) 555-8888 koene,philip cramer,maubelstr. 90,0555-09876 lacor,daniel tonini,67 avenue de l'europe,30.59.84.10 lamai,annette roulet,1 rue alsace-lorraine,61.77.61.10 laugb,yoshi tannamuri,1900 oak st.,(604) 555-3392 lazyk,john steel,12 orchestra terrace,(509) 555-7969 lehms,renate messner,magazinweg 7,069-0245984 letss,jaime yorres,87 polk st. suite 5,(415) 555-5938 lilas,carlos gonzalez,carrera 52 con ave. bolvar #65-98 llano largo,(9) 331-6954 linod,felipe izquierdo,ave. 5 de mayo porlamar,(8) 34-56-12 lonep,fran wilson,89 chiaroscuro rd.,(503) 555-9573 magaa,giovanni rovelli,via ludovico il moro 22,035-640230 maisd,catherine dewey,rue joseph-bens 532,(02) 201 24 67 merep,jean fresniere,43 rue st. laurent,(514) 555-8054 morgk,alexander feuer,heerstr. 22,0342-023176 norts,simon crowther,south house 300 queensbridge,(171) 555-7733 ocean the="" product="" order="" quantity="" is="" decreased="" by="" 1.="" if="" the="" order="" quantity="" is="" 0,="" then="" the="" product="" is="" removed="" from="" the="" order="" list.="" display="" the="" updated="" product="" details="" and="" order="" details.="" c.="" if="" the="" customer="" clicks="" the="" button="" ok,="" the="" new="" order="" is="" stored="" in="" the="" container="" orders="" and="" quits="" the="" window.="" d.="" if="" the="" customer="" clicks="" the="" button="" cancel,="" quit="" the="" window="" without="" saving="" the="" new="" order.="" 5.="" save="" the="" order="" details="" when="" a="" customer="" clicks="" the="" button="" save="" order,="" all="" the="" order="" details="" are="" saved="" to="" a="" text="" file="" orders.txt.="" 6.="" exception="" handling="" -="" 4/5="" -="" the="" system="" shall="" be="" able="" to="" handle="" the="" exceptions="" during="" the="" interaction="" between="" the="" customer="" and="" the="" system.="" the="" exceptions="" may="" include="" invalid="" information="" when="" loading="" customers="" and="" products.="" invalid="" data="" when="" a="" product="" is="" ordered.="" check="" the="" sample="" processing="" in="" a="" file="" assignment3_sampleprocessing.pdf="" and="" watch="" the="" demonstration="" video="" for="" more="" details.="" tasks="" task="" 1="" (1="" mark):="" update="" the="" uml="" class="" diagram="" based="" on="" the="" design="" given="" above.="" you="" are="" allowed="" to="" add="" new="" classes,="" more="" attributes,="" or="" more="" methods.="" task="" 2="" (7="" marks):="" implement="" the="" program="" according="" to="" the="" updated="" uml="" class="" diagram="" by="" using="" java.="" the="" program="" shall="" •="" be="" consistent="" with="" the="" uml="" class="" diagram;="" •="" design="" and="" implement="" the="" gui="" by="" using="" java="" swing.="" please="" make="" sure="" to="" use="" jframe,="" jpanel,="" jlabel,="" jtextfield,="" jbutton,="" jlist,="" jtextarea,="" etc.="" in="" your="" gui;="" •="" follow="" the="" conventions="" for="" naming="" all="" classes,="" variables,="" and="" methods,="" and="" provide="" sufficient="" comments;="" •="" be="" implemented="" by="" using="" the="" advanced="" oop="" features="" such="" as="" inheritance,="" polymorphism,="" abstraction,="" interface,="" and/or="" class="" downcasting.="" •="" be="" able="" to="" initialise="" the="" customers="" and="" products="" os;="" •="" be="" able="" to="" help="" the="" customer="" to="" complete="" the="" ordering="" via="" the="" gui;="" •="" be="" able="" to="" handle="" possible="" exceptions="" during="" the="" ordering="" process;="" •="" be="" able="" to="" view="" or="" modify="" the="" current="" order="" list="" via="" the="" gui;="" •="" be="" able="" to="" export="" the="" customer’s="" orders="" to="" a="" single="" text="" file.="" task="" 3="" (2="" marks):="" compilation="" and="" test.="" ="" please="" compile="" your="" program="" with="" ‘javac’="" and="" carefully="" test="" your="" program="" for="" all="" the="" requests.="" ="" test="" your="" program="" to="" all="" cases="" in="" gui.="" ="" please="" do="" not="" define="" the="" package="" in="" your="" program="" (a="" special="" alert="" for="" students="" who="" use="" ide="" to="" complete="" the="" assignment).="" submission:="" •="" please="" submit="" your="" solution="" to="" moodle="" (assignment="" 3).="" email="" submission="" is="" not="" accepted.="" •="" please="" submit="" an="" individual="" pdf="" document="" (ordersystem.pdf)="" that="" contains="" your="" answers="" for="" task="" 1="" and="" task="" 3.="" please="" include="" the="" updated="" uml="" class="" diagram="" for="" task="" 1.="" include="" the="" snapshots="" to="" clearly="" shows="" the="" compilation,="" and="" the="" execution="" of="" your="" program="" for="" task="" 2.="" you="" need="" to="" demonstrate="" all="" tasks="" with="" the="" gui.="" •="" please="" submit="" all="" java="" codes="" for="" task="" 2="" and="" make="" sure="" the="" primary="" class’s="" name="" is="" ordersystem.java.="" please="" submit="" the="" text="" file="" orders.txt="" created="" by="" your="" program="" in="" the="" test.="" notes:="" enquiries="" about="" the="" marks="" can="" only="" be="" made="" within="" a="" maximum="" of="" 1="" week="" after="" the="" assignment="" results="" are="" published.="" after="" 1="" week="" the="" marks="" cannot="" be="" changed.="" mark="" deductions:="" compilation="" errors,="" incorrect="" result,="" program="" is="" not="" up="" to="" spec,="" poor="" comments,="" poor="" indentation,="" meaningless="" identifiers,="" required="" numeric="" constants="" are="" not="" defined,="" the="" program="" -="" 5/5="" -="" uses="" approaches="" which="" have="" not="" been="" covered="" in="" the="" lectures.="" the="" deductions="" here="" are="" merely="" a="" guide.="" marks="" may="" also="" be="" deducted="" for="" other="" mistakes="" and="" poor="" practices.="" alfki,maria="" anders,obere="" str.="" 57,030-0074321="" anatr,ana="" trujillo,avda.="" de="" la="" constituci¢n="" 2222,(5)="" 555-4729="" anton,antonio="" moreno,mataderos="" 2312,(5)="" 555-3932="" arout,thomas="" hardy,120="" hanover="" sq.,(171)="" 555-7788="" bergs,christina="" berglund,berguvsv„gen="" 8,0921-12="" 34="" 65="" blaus,hanna="" moos,forsterstr.="" 57,0621-08460="" blonp,frederique="" citeaux,24="" place="" kleber,88.60.15.31="" bolid,martin="" sommer,c/="" araquil="" 67,(91)="" 555="" 22="" 82="" bonap,laurence="" lebihan,12="" rue="" des="" bouchers,91.24.45.40="" bottm,elizabeth="" lincoln,23="" tsawassen="" blvd.,(604)="" 555-4729="" bsbev,victoria="" ashworth,fauntleroy="" circus,(171)="" 555-1212="" cactu,patricio="" simpson,cerrito="" 333,(1)="" 135-5555="" centc,francisco="" chang,sierras="" de="" granada="" 9993,(5)="" 555-3392="" chops,yang="" wang,hauptstr.="" 29,0452-076545="" commi,pedro="" afonso,av.="" dos="" lusiadas="" 23,(11)="" 555-7647="" consh,elizabeth="" brown,berkeley="" gardens="" 12="" brewery="" ,(171)="" 555-2282="" dracd,sven="" ottlieb,walserweg="" 21,0241-039123="" dumon,janine="" labrune,67="" rue="" des="" cinquante="" otages,40.67.88.88="" eastc,ann="" devon,35="" king="" george,(171)="" 555-0297="" ernsh,roland="" mendel,kirchgasse="" 6,7675-3425="" famia,aria="" cruz,rua="" oros="" 92,(11)="" 555-9857="" fissa,diego="" roel,c/="" moralzarzal="" 86,(91)="" 555="" 94="" 44="" folig,martine="" rance,184="" chausse="" de="" tournai,20.16.10.16="" folko,maria="" larsson,�kergatan="" 24,0695-34="" 67="" 21="" frank,peter="" franken,berliner="" platz="" 43,089-0877310="" franr,carine="" schmitt,54="" rue="" royale,40.32.21.21="" frans,paolo="" accorti,via="" monte="" bianco="" 34,011-4988260="" furib,lino="" rodriguez,jardim="" das="" rosas="" n.="" 32,(1)="" 354-2534="" galed,eduardo="" saavedra,rambla="" de="" catalu¤a="" 23,(93)="" 203="" 4560="" godos,jose="" pedro="" freyre,c/="" romero="" 33,(95)="" 555="" 82="" 82="" gourl,andr‚="" fonseca,av.="" brasil="" 442,(11)="" 555-9482="" greal,howard="" snyder,2732="" baker="" blvd.,(503)="" 555-7555="" grosr,manuel="" pereira,5="" ave.="" los="" palos="" grandes,(2)="" 283-2951="" hanar,mario="" pontes,rua="" do="" paco="" 67,(21)="" 555-0091="" hilaa,carlos="" hernandez,carrera="" 22="" con="" ave.="" carlos="" soublette="" #8-35,(5)="" 555-1340="" hungc,yoshi="" latimer,city="" center="" plaza="" 516="" main="" st.,(503)="" 555-6874="" hungo,patricia="" mckenna,8="" johnstown="" road,2967="" 542="" islat,helen="" bennett,garden="" house="" crowther="" way,(198)="" 555-8888="" koene,philip="" cramer,maubelstr.="" 90,0555-09876="" lacor,daniel="" tonini,67="" avenue="" de="" l'europe,30.59.84.10="" lamai,annette="" roulet,1="" rue="" alsace-lorraine,61.77.61.10="" laugb,yoshi="" tannamuri,1900="" oak="" st.,(604)="" 555-3392="" lazyk,john="" steel,12="" orchestra="" terrace,(509)="" 555-7969="" lehms,renate="" messner,magazinweg="" 7,069-0245984="" letss,jaime="" yorres,87="" polk="" st.="" suite="" 5,(415)="" 555-5938="" lilas,carlos="" gonzalez,carrera="" 52="" con="" ave.="" bolvar="" #65-98="" llano="" largo,(9)="" 331-6954="" linod,felipe="" izquierdo,ave.="" 5="" de="" mayo="" porlamar,(8)="" 34-56-12="" lonep,fran="" wilson,89="" chiaroscuro="" rd.,(503)="" 555-9573="" magaa,giovanni="" rovelli,via="" ludovico="" il="" moro="" 22,035-640230="" maisd,catherine="" dewey,rue="" joseph-bens="" 532,(02)="" 201="" 24="" 67="" merep,jean="" fresniere,43="" rue="" st.="" laurent,(514)="" 555-8054="" morgk,alexander="" feuer,heerstr.="" 22,0342-023176="" norts,simon="" crowther,south="" house="" 300="" queensbridge,(171)="" 555-7733="">
Answered 5 days AfterOct 06, 2022

Answer To: Microsoft Word - Assignment3- 1/5 - SCIT School of Computing and Information Technology...

Manikandan answered on Oct 11 2022
54 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here