Create a menu of options that will be used in a switch case

Assignment Help C/C++ Programming
Reference no: EM13889489

Create a menu of options that will be used in a switch statement. The options for this program will be L) Load and Print Inventory File and Q) Quit. You will keep showing the menu and asking what option they want until they press Q to quit. We will be adding abilities to this program over the next few assignments so for now these are the only two options we will have. (hummm.... do you have another program you did something similar too that you might be able to take that code and turn it into this request?)

If loading (L) - ask the user for the filename - when using a string in the open file command you will have to use the string method c_str() this returns a c-style string that the open command is expecting --- for example if your string variable to hold the prompted filename is file_name and your ifstream variable is called infile the command would look like infile.open(file_name.c_str()); -- also you probably will need to clear the buffer before you read in the file_name (#include <limits> and use code as shown in assignment #9 for reading in a string)

The file will have part number (int), price (double), and description (string) -- use the file attached for this assignment. The fields will be separated by a comma (partno,price,description) - when you read in the file you will need to read in the comma as a single char just to get that character out of the file so you can read the next value.

You will need to create a part structure that will hold the above members (partno, price, description). (you will not be directly using this, you will only be touching this through the pointer that you will define in the next step).

You will need to create a pointer to the previous part structure you just created.

Using the pointer and the arrow operator, you will read from the file into the pointer->members. Also in your loop that you are reading the file, you will print the part number, description and price (using pointer->members). The description in the file is a string, so you will have to use the getline to read that in (it will be from your infile stream instead of the keyboard stream).

Reference no: EM13889489

Questions Cloud

Appositive or appositive phrase in the sentence : Choose the appositive or appositive phrase in the sentence. If the sentence has no appositive or appositive phrase, choose none.
The role of women in the church : The Role of Women in the Church. Your friend Mary wants to be involved in ministry at her church. Before she commits, she has a few questions about the role of women in the church in light of the debate between egalitarianism and complementarianis..
Introduction of needed piece of legislation : Be informed about the issue and then write your own views/opinions from personal knowledge or experience. Most importantly, use the evidence! Make your reason memorable to the legislator. Explain why what you request will improve life for this leg..
Design keyboard which plays any note on single octave : Design a keyboard which plays any note on a single octave. The user interface will consist of eight slide switches and a breadboard speaker circuit - Display the note being played as a character on the left-most seven-segment display. Display the ..
Create a menu of options that will be used in a switch case : Create a menu of options that will be used in a switch statement.
Define terms for matt and indicate balance in manufacturing : Matt Litkee is confused about under- and overapplied manufacturing overhead. Define the terms for Matt, and indicate the balance in the manufacturing overhead account applicable to each term.
What elements are involved in computing a overhead rate : What elements are involved in computing a predetermined overhead rate? How can the agreement of Work in Process Inventory and job cost sheets be verified?
Identify an area of nursing practice of interest : Identify an area of nursing practice of interest that requires further exploration, and write an evidence-based practice essay. Provide a background of the nursing issue/s
Open source vs propritery software : Predict the long-term use of both open source and proprietary software models and explain which software model has more legal implications/issues than the other.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd