Discuss the use of generics in your own words.
Consider a Billings system. The organization pays the water bill, k electric bill, gas bill of the customer. The payment of bills follows the queue structure for submission. You are required to build a generic bill payment class for the submission of bills.
Bill payment class should build the collection of bills of generic type. The following should be included in the class.
1) A default constructor which sets up an empty dictionary collection.
2) A add method should take a parameterized object which should be the element of the collection with a key.
3) A delete method should remove object.
4) Override the delete method that parameterized key value to delete the object. 5) Search method will search element with object or key.
Design a JavaFx application for “Course Module”. You need to design a registration screen that contains controls for id (TextField), course name (comboBox), Start date (Datepicker), Fees (TextField), and an Add button. The entered detail must be saved to the File using the java.io library. Before saving data to the file data must be validated. To validate data, perform the following:
Create a class named “Validation” that has a method named “checkId” and “checkFees”
responsible for validation of the id and fees entered.
1) The id value must contain a two-digit number otherwise an InvalidIdValueException will be
thrown.
2) The fees value must be between 13000 to 15000 otherwise as InvalidFeesException will be thrown.
Create classes for the mentioned Custom Exception with an appropriate constructor with string parameters to display the error message.
Write a program to implement the calculator’s basic functionality with an exception handler that deals with non-numeric operands; then write another program without using an exception handler to achieve the same objective. Your program should display a message that informs the user of the wrong operand type before exiting.
We've already made arraying/listing the easy way, but how about arraying/listing and printing the list in reverse order?
Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.
Input
The first line contains the size of the array/list.
The next lines contains the items of the array/list (integers).
5
1
64
32
2
11Output
Multiple lines containing integers.
11
2
32
64
1Class A {
public voit test () {
System.out.print("A");
}
}
Class B extends A {
public void test () {
System.out.print("B");
}
}
public class C extends A {
public void test () {
System.out.print("C");
}
public static void main (String [] args) {
A b1 = new A ();
A b2 = new C ();
b1 = (A) b2;
A b3 = (B) b2;
b1.test ();
b2.test ();
}
}
Write a java application that calculates and prints sum and average of any 30 numbers .Use a do while statement to loop through the calculation
Class A {
public void test ( ) {
Question: Peter runs a vehicle rental center. The vehicles are of three types; MICRO, MINI and SUV. The customer who travels in MICRO will pay Rs 15 per kilometer. The customer who travels in MINI will pay Rs 20 per kilometer and the customer whe travel in SUV will pay Rs 25 per kilometer. Write a Program in java to compute the cost of travelling by the customer with following requirements. a) The distance travelled by customer needs to be taken as input. b) The type of vehicle to be taken as input (M for Micro, m for mini, S for SUV). c) Check the type of vehicle and compute the final cost of the travel depending on the vehicle. d) Display the final cost with an appropriate message
JAVA FX BASED POKER TASK
Please show the output also
See apps.game.Cards for starter code representing a deck of playing cards.
5 Card Draw Poker has many rules, but to make it simple to implement we will only use some of these rules. Any student who wants to implement more is welcome, but remember that the following rules must be implemented.
Values for the Cards
The cards with two to nine showing are taken at face value
Rectangles in a Cartesian plane are represented by a class Rectangle that has four private fields as shown:
class Rectangle{
private int left
private int bottom
private int width
private int height
e.Write a class method, intersection, that has two Rectangle parameters. The method should return the rectangle formed by the area common to the two rectangles. If they do not intersect, the method should return the rectangle whose instance fields are all zero. If the rectangles touch, the method should return a "rectangle" of zero width or zero length.
Please answer whole question which is question 8 on http://ntci.on.ca/compsci/java/ch6/6_10.html