id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

totalCost


Define a function that when passed three integers - the first representing the fixed cost (one-time cost) of a business, the second representing the variable cost (monthly expenses), and the third representing the number of months the business has operated - returns the total cost of business so far.


totalCost(10, 5, 6) → 40
totalCost(1000, 900, 10) → 10000
totalCost(1, 0, 5000) → 1

...Save, Compile, Run (ctrl-enter)

int totalCost(int fixedCost, int variableCost, int nMonths) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 2 Post-solution available

Copyright Nick Parlante 2017 - privacy