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

 

srp4379@lausd.net > stamps
prev  |  next  |  chance

stamps(sheets,sheetsPerStamp): You want to mail a letter containing several sheets of paper. Given (a) the number of sheets (sheets) and (b) the maximum number of sheets you can mail with one stamp (sheetsPerStamp), return how many stamps you'll need to use to mail the letter. HINT: One efficient solution uses both the MOD (%) and DIVISION (/) operators in your code. RUBRIC: It is not enough to just solve the problem. Make sure you use PROPER INDENTATION. You MUST use CURLY BRACKETS for all loops and if/else statements. Also, the more EFFICIENT your solution, the higher your grade. If you have extraneous (superfluous / unnecessary) code, deductions will be taken.


stamps(10, 5) → 2
stamps(11, 5) → 3
stamps(5, 2) → 3

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

public int stamps(int numberSheets, int sheetsPerStamp) { }

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

Copyright Nick Parlante 2017 - privacy