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 16 Jul 2017 My Price 8.00

Hello, do you think you can help me with this assignment?

Hello, do you think you can help me with this assignment?

/*

 * Small class to practice writing JUnit tests 

 * Author: Renata Rand McFadden

 * version 1

 */

public class MyFax {

 

// attributes

private String type;      // fax type 

private String serial;    // fax serial number

private long number;  // phone number to dial - 10 digits (note that does not allow leading 0s)

 

// default constructor

// Assigns "None" to type and serial and -1 to number

public MyFax()

{

type = serial = "None";

number = -1;

}

 

// constructor

// throws IllegalArgumentException if either parameter is null or an empty string

// otherwise assigns parameter value of t to type and s to serial

public MyFax(String t, String s)

{

if (s == null || s == "")

{

throw new NullPointerException("Parameter cannot be null or empty");

}

type = t;   // assign t value of parameter to attribute type

serial = s; // assign s value of parameter to attribute serial

}

 

// returns current value of number attribute

public long getNumber()

{

return number;

}

 

// returns current value of type attribute

public String getType()

{

return type;

}

 

// returns current value of serial attribute

public String getSerial()

{

return serial;

}

 

// throws IllegalArgumentException if number is not a positive value or not 10 digits

// otherwise assigns parameter value of num to number attribute

// Implementation does not allow leading 0s

public void setNumber(long num)

{

int length = String.valueOf(num).length();

if (num < 1 || length < 10 )

{

throw new IllegalArgumentException("Parameter must be positive value and 10 digits");

}

number = num;   // assign num value of parameter to attribute number

}

 

}

 

 

Attachments:

Answers

Not Rated (0)
Status NEW Posted 16 Jul 2017 11:07 AM My Price 8.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)