primeiro commit com exercicios de Exercism realizados até esta data

This commit is contained in:
2026-10-17 22:10:27 +01:00
commit 58fccbe27a
708 changed files with 35038 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package cars
// CalculateWorkingCarsPerHour calculates how many working cars are
// produced by the assembly line every hour.
func CalculateWorkingCarsPerHour(productionRate int, successRate float64) float64 {
return float64(productionRate) * successRate/100.0
}
// CalculateWorkingCarsPerMinute calculates how many working cars are
// produced by the assembly line every minute.
func CalculateWorkingCarsPerMinute(productionRate int, successRate float64) int {
return int(float64(productionRate)/60 * successRate/100)
}
// CalculateCost works out the cost of producing the given number of cars.
func CalculateCost(carsCount int) uint {
var numberOfBundles uint = uint(carsCount/10)
return (numberOfBundles*95000) + (uint(carsCount)-(numberOfBundles*10))*10000
}