APlusGrades

Not Rated (0)

$15/per page/Negotiable

About APlusGrades

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,Foreign Languages,Geography,Geology,Health & Medical,HR Management,Law,Management,Physics,Programming,Science,Statistics Hide all
Teaching Since: Jul 2017
Last Sign in: 364 Weeks Ago, 2 Days Ago
Questions Answered: 1850
Tutorials Posted: 1850

Education

  • Graduate in Biology and Nutrition, MBA Finance
    Florida State University
    Aug-2000 - Jul-2007

Experience

  • Ass. Relationship Manager
    Penn-Florida
    Mar-2009 - Feb-2016

Category > Programming Posted 19 Jul 2017 My Price 12.00

countPositive We want to implement the method countPositive which does what the Python function count_pos was doing. To simplify things, we are not...

Q1: countPositive 

We want to implement the method countPositive which does what the Python function count_pos was doing.

To simplify things, we are not going to prompt the user. Instead, we are going to assume that a space-separated list of integers is passed on to the program as an argument. Here are two sample runs of our program:

> java A1Q1 1 2  3 0 5 -6 9  

5  

 

> java A1Q1 -5 -6 -9  

0

 

Q2: hasTwoLengthRun 

We want to implement the method hasTwoLengthRun which does what the Python function two_length_run was doing.

As before, the input will come from the command line. Here are some sample runs:

> java A1Q2  

false  

 

> java A1Q2 0  

false  

 

> java A1Q2 0 1  

false  

 

> java A1Q2 0 0  

true  

 

> java A1Q2 0 1 2 3 3 4 5  

true  

 

> java A1Q2 0 1 2 3 4 5 5  

true  

 

> java A1Q2 0 1 2 3 4 5  

false  

 

> java A1Q2 0 1 2 3 4 5 0  

false

 

Q3: getLongestRun 

We want to implement the method getLongestRun which does what the Python function longest_run was doing.

As before, the input will come from the command line. Here are some sample runs:

> java A1Q3  

0  

 

> java A1Q3 0 1 1 0 3  

2  

 

> java A1Q3 0 1 0 3  

1  

 

> java A1Q3 0 1 0 3 4  4  4  4 0 0  

4  

 

> java A1Q3 1 1 2 3 3 3 3 3 6 5  

5  

 

> java A1Q3 6 6 7 1 1 1 1 4 1  

4  

 

> java A1Q3 6 2 4 8 6  

1  

Answers

Not Rated (0)
Status NEW Posted 19 Jul 2017 10:07 AM My Price 12.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â-----------  -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I

Not Rated(0)