Paano po irename automatically yung mga na input na meal codes to specific name
parang ganito kumware nag input si user ng S1 tapos ganito ang lalabas na output
here's the code
parang ganito kumware nag input si user ng S1 tapos ganito ang lalabas na output
Code:
Summary of Order
1 * 5.00 Burger
here's the code
C++:
//Meal code s1 is burger
//meal code s2 is pizza
cout << "\tHow many meal codes?: ";
cin >> u_code_num;
for (int i=0; i<u_code_num; i++)
{
cin.ignore();
cout << "Meal Code: ";
cin >> u_code[i];
if (u_code[i] == "s1")
{
strcpy(meal_ordered, "Burger");
meal_price = 5.00;
}
else if (u_code[i] == "s2")
{
strcpy(meal_ordered, "Pizza");
meal_price = 6.00;
}
else
{
cout << "Meal code doesn't exist!"
}
}
cout << "Customer Name: " << cust_name << endl;
cout << "Customer Address: " << cust_add << endl;
cout << "Customer Contact Number: " << cust_num << endl;
cout << "Summary of Order\n";
for (int i=0; i<u_code_num; i++)
{
cout << i << meal_ordered << meal_price;
cout << "\n";
}