SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

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

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 13 Dec 2017 My Price 7.00

CountConsecutiveChars has only one method called run.

Write a public class call CountConsecutiveChars.

class CountConsecutiveChars has only one method called run.

specs for run:

name: run 
returns: nothing
arguments: none 
 
what it does: it uses the Scanner class to input a String entered by
	      the user.  It prints the number of times characters
	      repeat.  It reports the sum of all the runs as well as
	      the size of the largest.  Look at the examples.
	      "number" is the number of times a character was repeated
	      consecutively.  Lets call that a "run".  "max" is the
	      size of the largets run.  For example is the String is:
	      "aaxbbb", then the sum of all characters that were
	      repeated consecutively is 5 because a repeats 2 times
	      and b repeats 3 times.  The largest run was 3 (the b's).


Examples of runs:

% java CountConsecutiveChars
Enter a string: a
The number is 0
The max is 0

% java CountConsecutiveChars
Enter a string: aaa
The number is 3
The max is 3

% java CountConsecutiveChars
Enter a string: aaxbbb
The number is 5
The max is 3

% java CountConsecutiveChars
Enter a string: aaax
The number is 3
The max is 3

% java CountConsecutiveChars
Enter a string: aaxbbbxcc
The number is 7
The max is 3

Answers

(5)
Status NEW Posted 13 Dec 2017 01:12 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)