Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int input(string&pnome, string&pcognome, int&ptipostudente, int&pclasse){
  6. cout << "Inserisci nome: " ;
  7. cin >> pnome;
  8. cout << "Inserisci cognome: " ;
  9. cin >> pcognome;
  10. cout << "Inserisci tipo studente: " <<endl;
  11. cout << "(1) In corso" << endl;
  12. cout << "(2) Non in corso " << endl;
  13. cout << "(3) Anticipatario " <<endl;
  14. cin >> ptipostudente;
  15. cout << "Inserisci classe: " << endl;
  16. cout << "(1) Prima media" << endl;
  17. cout << "(2) Seconda media" << endl;
  18. cout << "(3) Terza media" << endl;
  19. cin >> pclasse;
  20. }
  21.  
  22.  
  23. int main() {
  24. string nome, cognome, risposta ;
  25. int tipostudente, classe, costo ;
  26.  
  27. do{
  28.  
  29. input(nome, cognome, tipostudente, classe) ;
  30.  
  31. switch (classe) {
  32. case 1:
  33. costo = 15;
  34. break;
  35. case 2:
  36. costo = 12;
  37. break;
  38. case 3:
  39. costo = 13;
  40. break;
  41. }
  42.  
  43. if (tipostudente = 2) {
  44. costo = costo + costo*0,10 ;
  45. }
  46.  
  47. costo = costo + costo*0,20 ;
  48.  
  49.  
  50.  
  51. cout << "Vuoi ripetere per un altro studente?" << endl;
  52. cin >> risposta;
  53.  
  54. cout << "//////////////////////////////////////////////" << endl;
  55.  
  56. cout << "Il nome dell'alunno e': " << nome << endl;
  57. cout << "Il cognome dell'alunno e': " << cognome << endl;
  58. cout << "L'alunno frequenta la: " << classe << "^a media" << endl;
  59. cout << "Il costo totale giornaliero equivale a: " << costo << "euro "<< endl;
  60.  
  61. cout << "//////////////////////////////////////////////" << endl;
  62.  
  63. } while (risposta == "SI" || risposta == "si");
  64.  
  65.  
  66.  
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement