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

 

norm.krumpe@muohio.edu 174oct24 > howManyLegs2
prev  |  next  |  chance

Given the number of cows and chickens on a farm, compute the total number of legs on those animals. If the farm is a mutant farm (indicated by the boolean parameter), then each animal has an extra leg.


howManyLegs2(1, 1, false) → 6
howManyLegs2(1, 1, true) → 8
howManyLegs2(1, 2, false) → 8

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

int howManyLegs2(int cows, int chickens, boolean areMutants) { }

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: 100

Copyright Nick Parlante 2017 - privacy