-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesercizio_5.cpp
More file actions
38 lines (31 loc) · 833 Bytes
/
esercizio_5.cpp
File metadata and controls
38 lines (31 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
using namespace std;
int main() {
int eta, ral;
char input_garanzie;
bool garanzie;
cout<<"inserisci la tua eta' ";
cin>>eta;
if (eta <=0) {
cout<<"eta' non valida ";
return 0;
}
cout<<"inserisci il tua RAL ";
cin>>ral;
cout<<"hai garanzie?(s/n) ";
cin>>input_garanzie;
if (input_garanzie!='s' and input_garanzie!='S'
and input_garanzie != 'n' and input_garanzie != 'N')
{
cout<<"input non valido";
return 0;
}
garanzie = (input_garanzie=='s') or (input_garanzie=='S');
bool prestito;
prestito = eta >= 21 and (garanzie or ral >=20000);
if (prestito) {
cout<<"evviva hai ottenuto il prestito!"<<endl;
}else {
cout<<"mi dispiace non hai ottenuto il prestito!"<<endl;
}
}