Is this code correct and can you fix any thing that is wrong with the code becau
ID: 3754833 • Letter: I
Question
Is this code correct and can you fix any thing that is wrong with the code because i want to be able to search my .txt. file like a database.
#include
#include
#include
using namespace std;
struct menu
int main()
{
ofstream output;
system("color of");
menuclass menuobject;
menuobject.menu();
string menu7, enter,showresults, choice;
string repet;
int menu;
int ch=-1;
struct menu;
string search;
while(ch!=-1)
cout << "Please pick one of the following drinks below" << endl;
cout <<"1.Display all of the clients information"<< choice<
cout <<"2.Search for first name" << choice<< endl;
cout <<"3.Search last name"<< choice<< endl;
cout << "4)" << "lemonade" << endl;
cout << "5)" << "water " << endl;
cout <<" Please enter your choice ";
getline (cin, choice);
cout<< "Please enter your search ";
getline(cin,search);
cin >> showresults;
cout <<"6. Do you want to continue and repet previous choice"<
cin>> repet;
cin >> menu;
{for(int x=0;x<1; x++)
cout<<"this is a loop ";
};
switch (menu)
{
case 1:
cout << "display all" << endl;
cout << "You have pressd 1" << endl;
break;
case 2:
cout << "Search for first name" << endl;
cout << "You have pressed 2" << endl;
getline(cin,enter);
{for(int x=0;x<1; x++)
cout<<"this is a loop ";
};
break;
case 3:
cout << "orange crush" << endl;
cout << "enjoy your orange crush" <
break;
case 4:
cout << "lemonade" << endl;
cout << "enjoy your lemonade" << endl;
break;
case 5:
cout << "water" << endl;
cout << "enjoy your water" << endl;
break;
case 6:
cout <<"repet"<
cout <<" You have chosen to repet your previous choice"<
if(choice<=choice<=0)
{
cout<<" invalid choice"<
}
}
void displayall()
return 0;
}
Explanation / Answer
#include <chrono>
#include <iostream>
auto start = std::chrono::high_performance_clock::now()
// Do Something
auto stop
= std::chrono::high_peformance_clock::now();
auto duration
= std::duration_cast<std::chrono::milliseconds>(stop - start);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.