Writing a Class
1. Fill in the blanks. (Note: The height of the triangle is longer than...
Computers and Technology, 05.05.2020 03:02, rachanachannagiri
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” + . );
}
}
Answers: 3
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
Computers and Technology, 23.06.2019 05:20, reeeeeee32
What did creator markus “notch" persson initially call his game
Answers: 1
Health, 28.08.2019 20:30
History, 28.08.2019 20:30
English, 28.08.2019 20:30
Mathematics, 28.08.2019 20:30
Social Studies, 28.08.2019 20:30
History, 28.08.2019 20:30