Don’t get to enter price can someone help | Sololearn: Learn to code for FREE!

0

Don’t get to enter price can someone help

#include <iostream> #include <string.h> using namespace std; int main() { int price, username,password; float tax,totalPrice; char response='Y'; cout <<"Enter Username: "; cin >> username; fflush(stdin); cout <<"Enter Password: "; cin >>password; fflush(stdin); if(username==1234&& password==6789) { do { cout <<"\nEnter price of your car: "; cin >> price; tax = 0.5*price/100; totalPrice=price+tax; cout <<"The total price of your car including tax is %2f\n"totalPrice; cout << "\nDo you want to check again(Y/N)? "; fflush(stdin); cin >> response; } while(response!='Y'); { cout <<"Enter price of your car: "; cin >> price; tax=25*price/100; totalPrice=price+tax; cout <<"Do you want to check again"; fflush(stdin); cin >> response; } } else { cout <<"Wrong Credentials"; } return 0; }

c++

3/29/2021 7:59:41 AM

David

4 Answers

New Answer

+1

okay thanks

0

the while was for calculating another tax of 25%