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

 

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

Write a method that accepts an integer parameter and returns an integer that has the first digit from the original number in the tens-place and the last digit from the original number in the ones-place. So 421781 results in 41 since the first digit is 4 and the last digit is 1. In solving this problem you are NOT allowed to use strings or arrays. NOTE: The original number will be a positive number with at least two digits.


shrinkNum123(124241) → 11
shrinkNum123(4289) → 49
shrinkNum123(4829) → 49

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

public int shrinkNum123(int num) { }

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

Copyright Nick Parlante 2017 - privacy