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, 3 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 11 Oct 2017 My Price 8.00

A class called NumberList represents a sequence of real numbers

java

1.

A class called NumberList represents a sequence of real numbers (doubles). Write the specification (prototype and pre and post conditions, Not The Body) for a member method that adds the data from one NumberList to the end of this NumberList. Of course, no input or output should be involved.

 

public class NumberList{

   private double[] a; private int na; //[0..na-1] holds the data

   // ... other stuff ...

      // your prototype and pre and post conditions:

2.

Person is a class that has just two fields, name and age. Assume it has public access methods getName and getAge and setName and setAge. Write a client method (i.e. a method that is not a member of Person) that is passed an array of Person and that returns an independent copy of the array. (Don't try to use clone.) Hint: the returned array must not refer to the same objects as the original array refers to. Don't forget to include the specification comments.

 

3.

Complete this method: This method is NOT a member of the Employee class.

(The class Employee is the one we worked on in lab; each Employee has attributes name, age, and boss and has public methods getAge, getName, and getBoss. Its constructor throws BadEmployeeException when given bad data.)

 

/**pre: list contains objects, some of which are Employees, but may

       contain other things also

 post: returns true iff at least one Employee in list has "Doug" as her boss

       throws an Exception if there are no Employees at all on the list

 */

static boolean hasDoug(ArrayList<Object> list) throws Exception{

 

4.

Here is a class for you to complete. It represents a single clown, whose attributes are his name, his age, and the name of his circus. Add as little as possible, but provide and label (using a,b,c, and d) the following:

a) A constructor

b) An access method

c) Code that overloads a method or constructor

d) Code that overrides a method or constructor

Also, explain why your Clown class is or is not immutable:

 

public class Clown extends Object{

   private String name,circus;

   private int age;

Answers

(5)
Status NEW Posted 11 Oct 2017 10:10 AM My Price 8.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)