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

 

jebbert@volusia.k12.fl.us > quiz2021_10_04_APSLHL_total
prev  |  next  |  chance

Write a method that returns the sum of a and b, unless 'doubleA' is true. In that case, count a twice! Look at the test data for examples.


quiz2021_10_04_APSLHL_total(5, 2, false) → 7
quiz2021_10_04_APSLHL_total(8, 10, false) → 18
quiz2021_10_04_APSLHL_total(8, 10, true) → 26

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

public int quiz2021_10_04_APSLHL_total(int a, int b, boolean doubleA) { }

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

Copyright Nick Parlante 2017 - privacy