5 Questions in java

Nov 5th, 2014
Steve1995
Category:
Computer Science
Price: $25 USD

Question description

Hello !

I need answers for these questions : 

#1.  Write a method called mostFrequentDigit that returns the digit value that occurs most frequently in an integer number.

#2. A Random object generates pseudo-random numbers. Assume that we simulate rolling of two 8-sided dice until both are even. 

     Write a program by generating random numbers usingRandom object.   

          The expected output is:

            (7, 4)

            (1, 3)

            (8, 7)

            (1, 1)

            (1, 2)

            (7, 3)

            (8, 5)

            (4, 2)

           You won after 8 tries!

#3. Write a method, handleNumbers(int[] numbers), which prints both the last element and the middle element of any array, after sorting (either ascending or descending order) the array sent as a parameter. 

#4.Write a method, duplicateNumbers(int[] numbers), which is supposed to return a new array with two copies of each value.

      Input:

        {2, 4, 6, 8, 10, 12}

      Output:

        {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12}


#5.The conditional expression with three operands or the question mark-colon operator follows the following syntax.

 Condition ?Expressiontrue : Expressionfalse

By using the above conditional expression (required), please write a method called passOrFail() whether returns true when the grade is greater than equal to 70 otherwise false (4 pts).

  public static boolean passOrFail(int grade) {

  } // absoluteValue

Please look at the questions before you offer 

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UC Berkeley
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
pmallory
Dec 3rd, 2016
" Totally impressed with results!! :-) "
mixedballz
Nov 24th, 2016
" excellent work as always thanks for the help "
Five Star Tutor
Nov 22nd, 2016
" Outstanding Job!!!! "
kiln82
Nov 10th, 2016
" awesome work thanks "
darnay
Nov 1st, 2016
" The best tutor out there!!!! "
likeplum4
Oct 28th, 2016
" Excellent work as usual "
kpcutie
Oct 5th, 2016
" Excellent job "
Joemoe
Sep 26th, 2016
" <3 it, thanks for saving me time. "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1830 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors