Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Create a new file named: CustomerDB. t x t . A customer data file contains a list o f customers ( o n e per
Create a new file named: CustomerDB. A customer data file contains a list customers per line each customer consisting a unique customer followed a first and last name. Mike Jones Garcia Sarah Lee Stan Lee Amy Hernandez Ask the user enter the find. you read from the file, search for the found, output the customer's info Customer #: Last, First not found, output Not Found what I have: #include ::ifstream #include ::cin, ::cout #include ::string int main ::string idToFind; string for cases both numbers and letters, like ::cout "Enter : ; ::cin idToFind; ::string dbId; ::string dbFirstName; ::string dbLastName; ::ifstream fin; fin.open; fin ::cout Error opening file for reading ; return ; while fin.fail return ;
Create a new file named: CustomerDB. A customer data file contains a list customers per line each customer consisting a unique customer followed a first and last name.
Mike Jones
Garcia
Sarah Lee
Stan Lee
Amy Hernandez
Ask the user enter the find.
you read from the file, search for the
found, output the customer's info Customer #: Last, First
not found, output Not Found
what I have:
#include ::ifstream
#include ::cin, ::cout
#include ::string
int main
::string idToFind; string for cases both numbers and letters, like
::cout "Enter : ;
::cin idToFind;
::string dbId;
::string dbFirstName;
::string dbLastName;
::ifstream fin;
fin.open;
fin
::cout
Error opening file for reading
;
return ;
while fin.fail
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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