Advertisement
TheBiagio1996

Untitled

Nov 1st, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <ctype.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float prezzo, pz_tot, sup;
  9. char tipo;
  10. cout<<"Inserire il prezzo: ";
  11. cin>>prezzo;
  12. cout<<"Inserire il tipo [A/B]: ";
  13. cin>>tipo;
  14.  
  15. tipo = toupper(tipo);
  16.  
  17. if (tipo=='A'){
  18. sup = (prezzo*7)/100;
  19. pz_tot = sup + prezzo;
  20. } else if (tipo == 'B') {
  21. sup = (prezzo*12)/100;
  22. pz_tot = sup + prezzo;
  23. } else {
  24. pz_tot = prezzo;
  25. }
  26. cout<<"Prezzo totale: " <<pz_tot;
  27. system("PUASE");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement