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, 6 Days 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

DetectPositiveNumbers The class has only one method:

For this assignment you are going to write code for the following ONE
class called:

DetectPositiveNumbers

The class has only one method:

name: run
accessibility: public
returns: nothing
arguments: none
what it does: 

-- method run reads an unspecified number of integers.  It counts how
   many positive and negative values have been read, and computes the
   total and average of the input values (not counting zeros).

-- the method run ends when it detects the input 0. 

-- it displays the average as a floating-point number. If only 0 is
   entered, the program should print:

no numbers are entered except 0

If you add the following main method (as a method of
DetectPositiveNumbers) you will be able to run the test runs shown
here:

    public static void main(String[] args){
        DetectPositiveNumbers det = new DetectPositiveNumbers();
        det.run();
    }

Here are some sample runs:

% java DetectPositiveNumbers
Enter integers below, program ends when 0 is entered: 
1
2
3
-5
3
-6
0
The number of positives is 4
The number of negatives is 2
The total is -2
The average is -0.3333333333333333

% java DetectPositiveNumbers
Enter integers below, program ends when 0 is entered: 
0
no numbers are entered except 0

% java DetectPositiveNumbers
Enter integers below, program ends when 0 is entered: 
2
3
0
The number of positives is 2
The number of negatives is 0
The total is 5
The average is 2.5

 

Answers

(5)
Status NEW Posted 13 Dec 2017 08:12 AM 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)