-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest1Zad2.cpp
More file actions
37 lines (37 loc) · 774 Bytes
/
Copy pathTest1Zad2.cpp
File metadata and controls
37 lines (37 loc) · 774 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
#include <iostream>
#include <cmath>
using namespace std;
//Konstantin Stoianov 3MI0700089
int main(){
double MoneyGoal;
double lev=1,Dstotinki=0.20,Pstotinki=0.05,Estotinka=0.01;
int counter=0;
do{
cout<<"Please input your money goal"<<endl;
cin>>MoneyGoal;
}while(MoneyGoal<0 && MoneyGoal>100);
while(MoneyGoal>=lev){
MoneyGoal-=lev;
counter++;
}
cout<<MoneyGoal<<" Lv. ="<<counter<<" X "<<lev<<" Lv. + ";
counter=0;
while(MoneyGoal>=Dstotinki){
MoneyGoal-=Dstotinki;
counter++;
}
cout<<counter<<" X "<<Dstotinki<<" Lv. + ";
counter=0;
while(MoneyGoal>=Pstotinki){
MoneyGoal-=Pstotinki;
counter++;
}
cout<<counter<<" X "<<Pstotinki<<" Lv. + ";
counter=0;
while(MoneyGoal>=Estotinka){
MoneyGoal-=Estotinka;
counter++;
}
cout<<counter<<" X "<<Estotinka<<" Lv.";
counter=0;
}