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

  Write a program that will read in 4 test scores

Write a program that will read in a list of numbers and double each number. Your program should work for any number of lines of data.

  Differences between a while loop and a do-while loop

What are the differences between a while loop and a do-while loop?

  Write a c program that reads n positive numbers from the

write a c program that reads n positive numbers from the keyboard calculates and displays the following information.a.

  Design a simple atm service kiosk

Design a simple ATM service kiosk. This kiosk supports the following options for its menu: 1. Viewing your account balance2. Depositing cash3. Withdrawing cash

  Reads a set of integers from file

The code in file "hw5-stree.cpp" reads a set of integers from file and inserts them into a binary search tree. You are asked to implement two functions max() and depth() that compute the maximum element and the depth of the binary search tree.

  Write c++ programs

Write a C++ program to accept distance in kilometers, coverts it to meters and then displays the result. Write a C++ program to find area and circumference of a circle.

  Write a function name is prime

Write a function name is Prime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the function in a complete program.

  Two types of constructors

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Creating virtual computer using c programming language

I need help with creating virtual computer using c programming language, the program should exactly work like a real computer

  In c++, write a program that calculates 10,000 tries.

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..

  Ansi-c program complete assignment as per written in the

complete assignment as per written in the attachment

  Write a program in which the program prints out

Use (switch statement) to write a program in which the program prints out the input (single character) if the character is not '2','t', or 'w'. Use 'default' and 'break' wisely.

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