-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConverter.cs
More file actions
33 lines (27 loc) · 805 Bytes
/
Converter.cs
File metadata and controls
33 lines (27 loc) · 805 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
public class Converter {
private double usd;
private double eur;
private double rub;
public Converter(double usd, double eur, double rub)
{
this.usd = usd;
this.eur = eur;
this.rub = rub;
}
public int convertUAHToUSD(double amount)
{
return (int)Math.Round((amount / usd));
}
public int convertUSDToUAH(double amount)
{
return (int)Math.Round(amount * usd);
}
public int convertEURToUAH(double amount) {
return (int)Math.Round(amount * eur);
}
public int convertRUBToUAH(double amount)
{
return (int)Math.Round(amount * rub);
}
}