Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pastebin of Code : https://pastebin.com/1jAUtDgi Detailed Algorithm 1. Define struct Dining containing the following 3 fields and 2 functions o name of dining location (string)
Pastebin of Code : https://pastebin.com/1jAUtDgi
Detailed Algorithm 1. Define struct Dining containing the following 3 fields and 2 functions o name of dining location (string) o coordinate x (double) o coordinate y (double) o default constructor Dining() o constructor with parameters Dining(const string& diningName, double x, double y) 2. Define readData() function that reads 3 fields from an input file to an instance of Dining 3. Define printData) function that prints 3 fields of an Dining instance to an output file 4. Define a vector of Dining elements 5. Read and process the first part of the input file o read data to an instance of Dining o push it to the vector o repeat until you read line "end 0 0" Read and process the second part of the input file o read location name to search into a string o find all occurrences of this string in the vector o for all found locations, print the location name and its coordinates to the output file and to the 6. console (cout) o repeat until you reach end of the input file Use the provided stub source code while writing your program (replace //ToDo comments with an actual code) Objective 1. review input/output from/to files 2. review structs 3. learn vector usageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started