📜  购物清单 c++ chegg - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:57.758000             🧑  作者: Mango

代码示例2
#include 
using namespace std;
int main()
{
int item=0;
float Milk=5.99;
float Egg = 6.99;
float Cheese = 10.98;
float Pasta = 2.75;
 
float cost=0.00;// take the starting cost 0
int count=0 ;//count of items
int tip=0;
float valueoftip=5.00;// value of the tip
float totalcost=0.00;
   cout<<"GROCERY SHOPPING ITEMS"<> item;
  
   switch (item) {
case 1:
cout << "Milk"<>count;
 
cout<<"Cost is : ";
cost=cost*count;
cout<>tip;
switch(tip)
{
   case 1:
       cost=cost+valueoftip;
cout<