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

 

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

Write a method that returns 'mult' times the larger value of 'num1' or 'num2'. For example, if num1=15, num2=20, and mult=3 you would return 60 since 20 is the larger value of num1 and num2 and 20*3=60. If num1 and num2 are the same value, just return their sum. As preconditions you may assume that num1>0, num2>0, and mult>=0. Look at the test data for examples.


test2021_12_15_APSLHL_blast(9, 6, 10) → 90
test2021_12_15_APSLHL_blast(17, 17, 40) → 34
test2021_12_15_APSLHL_blast(41, 5, 3) → 123

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

public int test2021_12_15_APSLHL_blast(int num1, int num2, int mult) { }

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

Copyright Nick Parlante 2017 - privacy