Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<string>
- #include<stdio.h>
- #include<stdlib.h>
- using namespace std;
- float pay,price,dis,change,sale;
- char username[30];
- char password[30];
- int main(){
- string ch_username="Cashier01",ch_password="adminadmin";
- printf("\t\t---stree shop---\n\n");
- printf("please login...");
- printf("\nusername:");
- scanf("%s",&username);
- printf("password:");
- scanf("%s",&password);
- if(username==ch_username&&password==ch_password){
- printf("\nHi Cashier01");
- printf("\nplease insert price:");
- scanf("%f",&price);
- printf("please insert pay:");
- scanf("%f",&pay);
- if(price>=1000){
- dis=(price/100)*5;
- sale=pay-dis;
- change=pay-sale;
- printf("customer got 5%% discount as %0.2f",dis);printf("Bath");
- printf("\nprice after discount is %0.02f",sale);printf("Bath");
- printf("\nplease change %0.02f",change);printf("Bath");
- }
- else{
- change=pay-price;
- }
- }
- printf("\n Wrong username or password\n");
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement