ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 Jun 2017 My Price 8.00

Design and implement a classMenu

I help on my java/data structure homework. Can anyone help me with how to approach this?Design and implement a class Menu which uses doubly linked lists as main data structures. A Menu object consists of a
set of main menu items, organized as a doubly linked list. Each main menu item has an associated submenu of items
which is also organized as a doubly linked list (see an example of a Menu object in the attached file MenuExample.pdf).
The class Menu should define a default constructor which builds an empty menu and the following methods:

 

Part 1Design and implement a classMenuwhich uses doubly linked lists as main data structures. AMenuobject consistsof aset ofmain menu items, organized as a doubly linked list. Each main menu item has an associatedsubmenu ofitemswhich is also organized as a doubly linked list (see an example of aMenuobject in the aTached FleMenuExample.pdf).±he classMenushould deFne adefault constructorwhich builds an empty menu and the following methods:addMainMenuItemfor adding a new main menu item with an empty submenuat the endof the list:public boolean addMainMenuItem(String newItem)addMainMenuItemBA, for adding a new main menu item with an empty submenubeforeoraFeran exis²ngmain menu item. If parameterbaistruethenewItemwill be added before theexisTngItemand ifbaisfalsethenewItemwill be added a³er theexisTngItem.public boolean addMainMenuItemBA(String newItem, String existingItem, boolean ba)deleteMainMenuItem, deletes the main menu item speciFed by name (supplied as method parameter).addSubMenuItem, adds a submenu item speciFed by name to a main menu item speciFed by name. Both namesshould be supplied as method parameters.toString, traverses the linked lists data structures and generates the string representa²on of a menu object,organized on rows. Each row should include the main menu item followed by its submenu items separated by asemicolon character. ±he last row of the string representa²on should include the number of main menu itemsand the total number of submenu items.Notes 1.1. ´or implemen²ng the classMenuyou may use either an appropriate data structure designed by you from scratchortheLinkedListdata structure deFned by JC´ (Java Collec²on ´ramework).2. If necessary, addi²onally methods may be deFned for the classMenu. Give reasons for the new added methods.±he classMenu.javashould compile without errors.Part 2Write a driver programTestMenu.javato test theMenuclass. In the driver program, do the following tasks:a)Read menu items from the input FleMenu.txtand build a menu object which includes the speciFed items. EachFleline contains a main menu item followed by its submenu items, all items being separated by the semicoloncharacter.Themain menu and its submenus should be built node by node with the values taken from the input ±le. A³erreading theFle and building the menu, display the menu using thetoStringmethod.Below is an example of the content of the input Fle Menu.txt:File;New;Open;Save;SaveAs;Close;View;Color;Gray;Zoom;Ruler;Grid;Process;Select;Move;Rotate;Scale;Delete;Group;About;Release;Version;Contact;Description;In this example,File, View, ProcessandAboutare the main menu items. ±he main menu itemFilehasNew, Open,Save,SaveAsandCloseas its submenu items.b)Consider a main menu itemInsertand its submenu items±able, PictureandShapes. Add this new main menuitem andits associated submenu to theMenuobject constructed ata). Ask the user to enter from the keyboard whether thenewmain menu item should be addedbeforeoraFerand exis²ng main menu item which will be also speciFed fromthekeyboard. Display the new menu using thetoStringmethod.c)Delete a main menu item speciFed by the user from the keyboard then display the menu using thetoStringmethod.

Attachments:

Answers

(11)
Status NEW Posted 02 Jun 2017 12:06 AM My Price 8.00

-----------

Not Rated(0)