This commit is contained in:
wagslane
2023-05-01 15:25:27 -06:00
parent f8912668b8
commit 9be3074de6
868 changed files with 58698 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
package main
import (
"fmt"
)
func bulkSend(numMessages int) float64 {
totalCost := 0.0
for i := 0; i < numMessages; i++ {
totalCost += 1 + (float64(i) * 0.01)
}
return totalCost
}
// don't edit below this line
func test(numMessages int) {
fmt.Printf("Sending %v messages\n", numMessages)
cost := bulkSend(numMessages)
fmt.Printf("Bulk send complete! Cost = %.2f\n", cost)
fmt.Println("===============================================================")
}
func main() {
test(10)
test(20)
test(30)
test(40)
test(50)
}