Advertisement
Guest User

Untitled

a guest
Aug 1st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. #include<string>
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. float pay,price,dis,change,sale;
  8. char username[30];
  9. char password[30];
  10.  
  11.  
  12. int main(){
  13. string ch_username="Cashier01",ch_password="adminadmin";
  14. printf("\t\t---stree shop---\n\n");
  15. printf("please login...");
  16. printf("\nusername:");
  17. scanf("%s",&username);
  18. printf("password:");
  19. scanf("%s",&password);
  20.  
  21.  
  22. if(username==ch_username&&password==ch_password){
  23.  
  24.  
  25. printf("\nHi Cashier01");
  26.  
  27.  
  28. printf("\nplease insert price:");
  29. scanf("%f",&price);
  30.  
  31. printf("please insert pay:");
  32. scanf("%f",&pay);
  33.  
  34. if(price>=1000){
  35. dis=(price/100)*5;
  36. sale=pay-dis;
  37. change=pay-sale;
  38. printf("customer got 5%% discount as %0.2f",dis);printf("Bath");
  39. printf("\nprice after discount is %0.02f",sale);printf("Bath");
  40. printf("\nplease change %0.02f",change);printf("Bath");
  41. }
  42. else{
  43. change=pay-price;
  44. }
  45. }
  46. system("pause");
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement