Computers and Technology

Writing a Class

1. Fill in the blanks. (Note: The height of the triangle is longer than the base)

{ public class Triangle
int base;
int height;

public Triangle( )
{
= 5; =10;
}

public Triangle(int b, int h )
{
= ;
= ;
}

public getBase( )
{

;
}

public setBase( )
{

= ;
}

}

2. Fill in the blanks.

public class triangleDriver
{ public static main(String args[])
{
triangle1 = Triangle( );
System. out. println(“The triangle’s height is” + . );
}
}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:50, youngboymark123
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, bri2008
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 23.06.2019 05:20, reeeeeee32
What did creator markus “notch" persson initially call his game
Answers: 1
Do you know the correct answer?
Writing a Class

1. Fill in the blanks. (Note: The height of the triangle is longer than...

Questions in other subjects:

Konu
English, 28.08.2019 20:30
Konu
Social Studies, 28.08.2019 20:30
Konu
History, 28.08.2019 20:30