Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IS THERE A WAY TO SOLVE THESE CODING PROBLEMS BY NOT CALLING System.println() or System.print(), but returning a result value and starting with the following

IS THERE A WAY TO SOLVE THESE CODING PROBLEMS BY NOT CALLING System.println() or System.print(), but returning a result value and starting with the following code in the pictures? IN DESPERATE NEED OF HELP PLEASEEEE

image text in transcribedimage text in transcribed

Given a nonzero int that is one or two digits long, return the rendering of that word in English. The word rendering should be in all lower case. Starting at the number 21 , the linguistic rendition is hyphenated, so 62 is rendered as "sixty-two" Note: zero through 19 are all special cases. The 20,30 , etc. etc. 80, 90 are all special cases. After that, you can solve ALL of the hyphenated ones with recursion! 42 is just rendering 40 and rendering 2 with a dash in between! wordNumber(0) "zero" wordNumber(42) "forty-two" wordNumber(50) "fifty" ...Save, Compile, Run (ctrl-enter) String wordNumber (int n ) \{ wordTime Given a String t indicating the time in 24-hour notation as follows: hour:minute Return the time in text in the 12 hour format as follows: five forty-two P.M. - Hours 0 - 11 are 12 AM to 11 AM - Hours 12 - 23 are 12 PM to 11 PM - If the minute is zero, omit it, ex "04:00" yields "four A.M." - If the minute is under ten, add an "oh", ex "06:07" yields "six oh seven A.M." wordTime("03:10") "three ten A.M." wordTime("13:09") "one oh nine P.M." wordTime("00:48") "twelve forty-eight A.M." Go ...Save, Compile, Run (ctrl-enter) String wordTime(String t) \{ String [] arr = t.split(":") int h= Integer.parseInt(arr [0]) int m= Integer.parseInt(arr [1]) \}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

Students also viewed these Databases questions

Question

What process do you have in place for development planning?

Answered: 1 week ago

Question

What guidance are you giving managers on pre- and post- briefing?

Answered: 1 week ago