Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Java Expert


Home >> Java

problem 1) prepare code which allows a user to make a grocery list. The program would also allow the user to export grocery lists to comma delimited file that could be read by a spreadsheet program (i.e., CSV file) No classes are needed, just a main function.

The function declarations are:

a) void DisplayMenu();

b) void CreateList( map< string, vector >& lists );

c) void ExportLists( map< string, vector >& lists );

The main program should:

1) Use DisplayMenu function to display the menu.

2) Prompt the user for a menu choice.

3) Use CreateList and ExportLists functions to execute the user's choice.

4) Exit if user chooses to exit.

5) Re-prompt the user for invalid choices.

The main program should store grocery lists in the map of key-value pairs called: lists. The key should be a string containing a grocery store name and value should be a vector of strings containing the grocery list of items for that store.

The DisplayMenu function should show the following options:

1) Create a new grocery list

2) Export grocery lists

3) Quit

The CreateList function should:

1) Ask the user for a grocery store name.

2) Ask the user to enter a list of items for this grocery store, until the user enters “done”.

3) Add the items to the vector of strings as they are entered.

4) Display: “Added item to grocery store name list.” after each item is entered, where “item” is the item entered and “grocery store name” is the name entered in Step 1 above.

The ExportLists function should:

1) Ask the user for an output file name.

2) Display: “Writing to filename...”, where “filename” is the output file name entered by the user.

3) Use iterator for-loops to read map called, lists, and save values in a CSV file with two columns. The first column’s header must be: Grocery Store; and the second column’s header should be: Item.

4) Display: “Grocery lists written to filename”, where “filename” is the output file name entered by the user.

Java, Programming

  • Category:- Java
  • Reference No.:- M94584

Have any Question? 


Related Questions in Java

Develop an application in java to accept the number of

Develop an application in Java to accept the number of students in a section for a subject and for each student accept the student number, Student name, prelim marks, midterm marks, final marks. The final grade should be ...

Java- object-oriented and concurrent programmingheres a

Java- Object-Oriented and Concurrent Programming Here's a very quick overview of the projects: 1. Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the s ...

Java programmingyou have been asked by your manager to

Java programming You have been asked by your manager to create a user-friendly application that will present a survey to your customers. The application will compile and analyze the results entered by the survey responde ...

Pogramming assignmentmickeymouse- x int- y int- size

Programming Assignment MickeyMouse - x : int - y : int - size : int -color: Color + MickeyMouse(): + setLocation (x: int, y: int): void + setSize (size: int): void + setColor(color: Color):void + draw(canvas: Graphics2D) ...

Chapter 1 - challenge 3 - training workshopsyour company

Chapter 1 - Challenge #3 - Training Workshops Your company likes to present training workshops that help people in the information technology industry improve their skills. Your task is to write and object-oriented appli ...

Question 1 illustrate that the nodes of any avl tree t can

Question 1. Illustrate that the nodes of any AVL tree T can be colored "red" and "black" so that T becomes a red-black tree. Question 2. Illustrate that via AVL single rotation, any binary search tree T1 can be transform ...

Programmers often develop different types of accounts to

Programmers often develop different types of accounts to provide access to a program for a variety of users. The structure of each account is formatted based on the needs of the user and how the program will be used. One ...

The class below has some errors for each error do the

The class below has some errors. For each error do the following: a) Write the erring section of code and explain what the error is. b) Fix the error (i.e. re-write the code correctly). public class ClassWithErrors { pub ...

Below is the beginning of a java classpublic class

Below is the beginning of a Java class. public class Implement { private String name; private boolean hasMovingParts; private String constructedFrom; public Implement() { } a) Complete this class so that: i. The instance ...

Java question1write an application that prompts a user for

JAVA Question 1. Write an application that prompts a user for a month, day, and year. Display a message that specifies whether the entered date is not this year, in an earlier month this year, in a later month this year, ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate