Advertisement
Guest User

PRELIM LAB2

a guest
Jun 25th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. //Data types
  2. #include<iostream>
  3. using namespace std;
  4.  
  5.  
  6. main()
  7. {
  8. //variables
  9. char csh[80];
  10. string prod1; double qty1; double price1, total1=0;
  11. string prod2; double qty2; double price2, total2=0;
  12. double total3= 0;
  13. string cashier;
  14.  
  15.  
  16. //prod1
  17. cout<<(" Enter Cashier Name : "); cin>> cashier;
  18. cout<<(" Enter Product Name: "); cin>> prod1;
  19. cout<<(" Enter Quantity: "); cin>> qty1;
  20. cout<<(" Enter Price: "); cin>> price1;
  21.  
  22. //secretformula
  23. total1= qty1*price1;
  24. cout<<" Total: "<<total1;
  25.  
  26. //prod2
  27. cout<<("\n Enter Product Name: " ); cin>> prod2;
  28. cout<<(" Enter Quantity: "); cin>> qty2;
  29. cout<<("Enter price:"); cin>> price2;
  30.  
  31. total2= qty2*price2;
  32. cout<<"total: "<<total2;
  33. cout<<("\n\nProduct Name \t Quantity \tPrice\t\tTotal\n\n");
  34. cout<<prod1 <<"\t\t" <<qty1 << "\t\t"<< price1 <<"\t\t"<<total1;
  35. cout << endl;
  36. cout<<prod2 <<"\t" <<qty2 << "\t "<< price2 <<"\t "<<total2;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement