Course Solutions Uncategorized (Solved) : C Code Inventorydat File Supposed Pull Re Read Directions Discovered Supposed Using Array Q27529234 . . . .

(Solved) : C Code Inventorydat File Supposed Pull Re Read Directions Discovered Supposed Using Array Q27529234 . . . .

 

C++ I have code for a inventory.dat file we are supposed to pullfrom. I re-read the directions and discovered we are not supposedto be using arrays. Any suggestions? Here is my code.

#include <iostream>

#include <fstream>

#include <string>

#include <stdlib.h>

using namespace std;

const int DESC_SIZE = 40;

struct Product

{

long prodNum;

char prodName[DESC_SIZE];

double price;

int qty;

};

//function prototypes

int showMenu();

void printFile(fstream&);

void displayRecord(fstream&);

void modifyRecord(fstream&);

//main function

int main()

{

long choice;

//declare a fstream file object

fstream inventory;

do

{

choice = showMenu();

switch (choice)

{

case 1: //Display product inventory file

printFile(inventory);

break;

case 2: //Display a particular product

displayRecord(inventory);

break;

case 3: //Modify a product

modifyRecord(inventory);

break;

default: //Invalid selection

cout << “Invalid selection.” << endl;

}

}while (choice != 4);

cout << “Thank you. Good bye.” << endl;

inventory.close();

system(“pause”);

return 0;

}

// function that prompts user to

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

(Solved) : 21 Consider Tcp Connection Host Host B Suppose One Tcp Segment Traveling Host Host B Follo Q35161345 . . . .(Solved) : 21 Consider Tcp Connection Host Host B Suppose One Tcp Segment Traveling Host Host B Follo Q35161345 . . . .

<p><img alt="21 Consider a TCP connection between Host A and Host B. Suppose that one TCP segment traveling from Host A to Host B has the" src="https://media.cheggcdn.com/media%2F3db%2F3db9b905-f832-41a7-aa31-693e00bc5532%2Fphp6LeeJ6.png" style="height:209px;width:603px;" aria-describedby="d3f"/></p>21 Consider