I got this induction proof solution from a answers Expert that proves every logic formula has a unique parse tree, and I a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

I got this induction proof solution from a answers Expert that proves every logic formula has a unique parse tree, and I a

Post by answerhappygod »

I got this induction proof solution from a answers Expert thatproves every logic formula has a unique parse tree, and I am tryingto figure out where the bugs are. Please help me!
--------------------------
#incorporate <iostream>
#incorporate <iomanip>
#incorporate <fstream>
#incorporate <string>
utilizing namespace sexually transmitted disease;
const int menuItems = 8;
struct menuItemType {//VARIABLES
string menuItem;
twofold menuPrice;
int count_1;//variable initializon
menuItemType() {
menuItem = "";
menuPrice = 0.0;
count_1 = 0;
}
};
class menuClass {
private:
string itemName;
twofold cost;
public:
menuClass() {
struct menuItemType {//VARIABLES
string menuItem;
twofold menuPrice;
int count_1;//variable initializon
menuItemType() {
menuItem = "";
menuPrice = 0.0;
count_1 = 0;
}
};
}
menuClass(string Name, twofold Price) {
itemName = Name;
cost = Price;
}
// getter for thing name
string getName() {
return itemName;
}
// getter for thing cost
twofold getPrice() {
bring cost back;
}
void showMenu(menuItemType menuList[], int x) {
// Capability factors
int count;
cout << "Welcome to Johnny's Restaurant! " <<endl;
cout << " ===== Menu List ======" << endl;
for (count = 0; count < x; count++) {
cout << setw(1) << left << "[" << count+ 1 << "]";
cout << setw(20) << left <<menuList[count].menuItem << '$' <<menuList[count].menuPrice << endl;
}
}
//void information goes underneath
void getData(menuItemType menuList[]) {
ifstream myFile;
string thing, s;
twofold cost;
int I = 0;
myFile.open("menu.txt");
while (getline(myFile, thing, '$')) {
myFile >> cost;
getline(myFile, s, '\n');
menuList.menuItem = thing;
menuList.menuPrice = cost;
i++;
}
myFile.close();
}
void printCheck(menuItemType menuList[]) {
twofold checkTotal = 0;
twofold checkTax = 0;
const twofold TAX = .05;
cout << "\t===== ORDER SUMMARY =====" << endl;
for (int I = 0; I < 8; i++) {
if (menuList.count_1 != 0) {
cout << setw(5) << left << menuList.count_1<< setw(20) << left << menuList.menuItem<< '$' << menuList.menuPrice * menuList.count_1<< endl;
checkTotal += (menuList.menuPrice * menuList.count_1);
}
}
checkTax = checkTotal * TAX;
checkTotal += checkTax;
cout << setw(15) << left << " Tax" <<setw(11) << right << "$" << checkTax <<endl;
cout << setw(14) << left << " Amount Due "<< setw(12) << right << "$" << checkTotal<< endl;
system("pause");
}
};
menuItemType menuList[menuItems];
int primary() {
// set accuracy to 2 for cash
cout << setprecision(2) << std::fixed;
// capabilities and variable
int orderChoice = 0;
bool requesting = valid;
int count = 0;
// Capability CALLING
menuClass obj;
obj.getData(menuList);
obj.showMenu(menuList, menuItems);
while (requesting) {
cout << "Select your ideal thing... \n";
cout << "Type 0 assuming that you are get done withrequesting." << endl;
cin >> orderChoice;
if ((orderChoice > 0 && orderChoice <= menuItems)&& menuList[orderChoice - 1].count_1 > 0) {
++menuList[orderChoice - 1].count_1;
}
else if (orderChoice > 0 && orderChoice <=menuItems) {
++menuList[orderChoice - 1].count_1;
}
else {
requesting = bogus;
}
}
obj.printCheck(menuList);
bring 0 back;
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply