Skip to content

Commit 5d37afc

Browse files
authored
fix(freelancer-rates): avoid conversion warning in exemplar (#916)
1 parent 835b7a7 commit 5d37afc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

exercises/concept/freelancer-rates/.meta/exemplar.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ int monthly_rate(double hourly_rate, double discount) {
1919
int workdays_per_month{22};
2020
double per_month{per_day * workdays_per_month};
2121
double after_discount{apply_discount(per_month, discount)};
22-
int rounded_up{std::ceil(after_discount)};
23-
24-
return rounded_up;
22+
// Round up with std::ceil
23+
return std::ceil(after_discount);
2524
}
2625

2726
// days_in_budget calculates the number of workdays given a budget, hourly rate,

0 commit comments

Comments
 (0)