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

Jva programmingmodify the given java application attached

JAVA PROGRAMMING Modify the given Java application (attached) using NetBeans IDE to meet these additional and changed business requirements: • The application will now compare the total annual compensation of at least tw ...

Submit one properly named rtf document inside your one jar

Submit one properly named .rtf document inside your one .jar file. lastname.firstname.mod4. 1. What is the characteristic behavior of a stack? 2. What is the characteristic behavior of a queue? 3. What are the advantages ...

Questions for java programing answer each question with at

QUESTIONS FOR JAVA PROGRAMING (answer each question with at least 5 sentences) 1. Discuss why it is necessary to use repetitive and selective statement. Use segment codes to demonstrate your understanding. Explain why yo ...

Programming assignmentyou to write a class named

Programming Assignment You to write a class named WeaklyCalendar. This class must be in a package named pa4. Note that the description of a programming assignment is not a linear narrative and often requires multiple rea ...

Java application - distancecalculatorcreate a java

Java Application - DistanceCalculator Create a Java application named DistanceCalculator.java to solve the following problem. An application is needed to allow a user to enter two cities and display the distances between ...

Design your own java class that includes at least 3 data

Design your own Java Class that includes at least 3 data fields, 2 constructors and 4 methods. When designing your class, pick an object that you are familiar with and make it your own, realistic, yet simple design with ...

The taskyou must design and implement in java a bookshop

The Task You must design and implement in Java a Bookshop Management System corresponding to the attached scenario. You are not required to implement the entire scenario, but the more functionality your system has, the h ...

Assignmentobjectivethis project focuses on demonstrating

Assignment Objective This project focuses on demonstrating your understanding of Java Collections. Before attempting this project, be sure you have completed all of the reading assignments listed in the syllabus to date, ...

Write a java application using netbeans integrated

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of . ...

Javawrite a program that finds and prints all the solutions

**java**write a program that finds and prints all the solutions to the N queens problem for a given N. At the end of your program, print how many solutions were found. What is the N-Queens problem, you ask? 1) Google it. ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen