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

Write java program with eclipsinstructionswrite a program

Write java program with Eclips INSTRUCTIONS Write a program that will help a student practice basic math (addition, subtraction, multiplication, and division). Display a menu the student can select from. The student will ...

Assignment 1overviewthis is an individual assignment that

Assignment 1 Overview This is an individual assignment that requires you to design, develop and test a small procedural Java program. Timelines and Expectations Learning Outcomes Assessed The following course learning ou ...

Assignment introduction to programming using java1 write a

Assignment: Introduction to Programming Using Java 1. Write a program that uses one of the Map classes to implement a contact list. Contact information should include first name, last name, a phone number and an email ad ...

Casegreentek is a software solution company for smartphone

Case Greentek is a software solution company for smartphone and tablet devices. Current headquarter (HQ) locates in Sydney, 30 sale team members and 50 software engineers base in Singapore and Manila respective. The cycl ...

Assignmentin this assignment you are required to specify

Assignment In this assignment, you are required to specify and implement a Java The language is Java. In this assignment, you are required to specify and implement a Java class named IntSortedList. The instances of IntSo ...

Write a java application that allows a user to enter

Write a Java application that allows a user to enter numbers into an array and then process them. Enter the number of elements and the value of each element; Your application will process the data entered and will displa ...

Importantuse jgrasp for editingobjectives - at the

IMPORTANT: use JGRASP for editing. Objectives - At the conclusion of this assignment students will have demonstrated that they can: Validate input data from a keyboard. Use loops to repeat actions in a program Use a Rand ...

Java programmingwrite a java application using netbeans

JAVA PROGRAMMING 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 ...

Assignmentproductjavacreate a class to encapsulate the data

Assignment Product.java Create a class to encapsulate the data and behavior of a product in a store's inventory. The class should have the following data for an inventory item: Product Number - String Description - Strin ...

1how does java support the concept of encapsulation2

1. How does Java support the concept of encapsulation? 2. Describe the difference between an object and a class. 3. What is the difference between the contents of a Java variable of a primitive type and a Java variable o ...

  • 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