Course Solutions Uncategorized (Solved) : M Attempting Read Data Text File Format Plain Egg145bacon Egg245muffin099french Toast199fr Q29361600 . . . .

(Solved) : M Attempting Read Data Text File Format Plain Egg145bacon Egg245muffin099french Toast199fr Q29361600 . . . .

 

I’m attempting to read data from a text file in the format:

Plain Egg1.45Bacon and Egg2.45Muffin0.99French Toast1.99Fruit Basket2.49Cereal0.69Coffee0.50Tea0.75

etc….

I’m doing this by attempting to read the data into an arraymenuList[] of type menuItemType, within my function getData, usinga while loop with either ‘eof()’, ‘ifstream’, or ‘ifstream >>variable’ as parameters. The issue is that the while loop stopsafter the first iteration…Source Code:

#include <iostream>#include <iomanip>#include <string>#include <cmath>#include <fstream>using namespace std;//Structure Definitionsstruct menuItemType{ string menuItem; // menu item name double menuPrice; // menu item price};//Function prototypevoid getData(menuItemType menuList[], ifstream&);void showMenu(menuItemType menuList[]);//Global Variables//Main Functionint main() { //Declarations

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post