1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jolli1 [7]
3 years ago
13

LAB: Parsing food data in C++

Computers and Technology
1 answer:
fgiga [73]3 years ago
4 0

Answer:

Implementation of the given problem in C++:

#include <bits/stdc++.h>

using namespace std;

int main() {

 vector<string> category, name, description, availability;

 string str;

 cout << "Enter the name of text file to open: ";

 cin >> str;

 ifstream file(str);

 while (getline(file, str)) {

   size_t pos1 = str.find('\t');             // to find the first tab delimiter

   size_t pos2 = str.find('\t', pos1 + 1);   // to find the second tab delimiter

   size_t pos3 = str.find('\t', pos2 + 1);   // to find the third tab delimiter

   category.push_back(str.substr(0, pos1));

   name.push_back(str.substr(pos1 + 1, pos2 - pos1 - 1));

   description.push_back(str.substr(pos2 + 1, pos3 - pos2 - 1));

   availability.push_back(str.substr(pos3 + 1, str.length() - pos3));

 }

 for (int i = 0; i < name.size(); i++)

   if (availability[i] == "Available")

     cout << name[i] << " (" << category[i] << ") -- " << description[i] << endl;

}

Output:-

You might be interested in
Sean is studying at a friend's house and notices that he can connect to the wireless network without entering a wireless network
polet [3.4K]
It is a personal network of Sean’s friends family’s
5 0
3 years ago
Integrated circuits incorporate many transistors and electronic circuits on a single tiny silicon chip, allowing ____ to be even
olga55 [171]

Integrated circuits incorporate many transistors and electronic circuits on a single tiny silicon chip, allowing <u>Third generation computers </u>to be even smaller and more reliable than earlier computers.

<h3>What are the Third generation computers?</h3>

The Third generation computers are known to be a kind of a computers that was said to have came about as a result of the growth and development of the integrated circuit (IC).

Note that they are said to be the first steps toward computers  and as such,  the Integrated circuits incorporate many transistors and electronic circuits on a single tiny silicon chip, allowing <u>Third generation computers </u>to be even smaller and more reliable than earlier computers.

Learn more about Integrated circuits from

brainly.com/question/1156455

#SPJ1

6 0
2 years ago
In the Sender Message Channel Receiver (SMCR) model, the ______ is the large, bureaucratic organization that produces messages.
mafiozo [28]

Answer:

Sender.

Explanation:

The Sender Message Channel Receiver (SMCR) model of communication was developed and created by David Berlo in 1960. SCMR was developed from the Shannon-Weaver model of communication of 1949.

The SCMR model of communication comprises of four (4) main components and these are;

1. Sender (S): this is typically the source of information (message) or the originator of a message that is being sent to a receiver. Thus, they are simply the producer of a message.

2. Channel (C): this is the medium used by the sender for the dissemination or transmission of the message to the recipient. For example, telephone, television, radio, newspapers, billboards etc.

3. Message (M): this is the information or data that is being sent to a recipient by a sender. It could be in the form of a video, audio, text message etc.

4. Receiver (R): this is typically the destination of information (message) or the recipient of a message that is being sent from a sender.

Hence, in the Sender Message Channel Receiver (SMCR) model, the sender is the large, bureaucratic organization that produces messages.

Additionally, encoding is the process of transmitting the message from the sender to the recipient while decoding is the process of interpreting the message that is being received from a sender.

7 0
3 years ago
Which area would a Gaming Designer fall under? Research and explain why you think so. Make sure to site your source and where yo
pshichka [43]

Answer: Game Artist, Game Designer or Game Programmer.

Explanation:

All of which fall under a “Game Designer”

5 0
3 years ago
The amount of pressure a power source creates to move electrons. *
Ksju [112]

Answer:

go to gogle

Explanation:

do it it giv ansewr better xd

3 0
3 years ago
Other questions:
  • Which of the following sentences is written in the active voice
    12·2 answers
  • Many of the special staff teams require leadership training, which is offered to staff with more than 1 year of service at Camp
    15·1 answer
  • Median of a sample If the distribution is given, as above, the median can be determined easily. In this problem we will learn ho
    15·1 answer
  • Matt is a senior developer for Cyber Protect, a company that helps secure management information systems. Matt's new task is to
    8·1 answer
  • What does a codec do? Choose all that apply.
    5·2 answers
  • Sally is editing her science report about living things. She needs to copy a paragraph from her original report.
    13·1 answer
  • Write a calculator program using a switch statement that: a) Prompts the user to enter two numbers b) Prompts the user to select
    6·1 answer
  • What can a user modify on a business card using the Edit Business card in the dialog box?​
    8·1 answer
  • A file named "dogs.txt" exists and has 60 lines of data. You open the file with the following line of code.
    5·1 answer
  • Project: Digital Media and Business
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!