Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 2 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Management Posted 03 Oct 2017 My Price 8.00

unspecified number of integers,

Write a program in java that reads an unspecified number of integers, finds the largest of them, and counts its occurrences. The reading of input ends when the user enters 0 (zero). Design the program such that it asks the user if they want to continue with new inputs after each set of entries, ending the program only when they do not respond to the question with "yes".

 

Hint: One way to implement this program is to maintain two integer variables, max (which stores the current maximum number) andcount (which stores its occurrences). Initially, assign the first number to max and 1 to count. Compare each subsequent number withmax. If the number is greater than max, assign it to max and reset count to 1. If the number is equal to max, increment count by 1.

 

Here is a sample run:

Enter numbers: 3 5 2 5 5 5 0 The largest number is 5 The number of times the largest number occurred is 4 Would you like to continue with new inputs? yes Enter numbers: 10 -5 10 1 2 7 7 7 0 The largest number is 10 The number of times the largest number occurred is 2 Would you like to continue with new inputs? no

Answers

(5)
Status NEW Posted 03 Oct 2017 08:10 PM My Price 8.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)