What is the out of the following... system.out.println(str.substring(0,5));
A teen ager Sport Club offers many sports to the registered members write a java code to keep facilitate the players.
Create a class name Play
⦁ Create the following method name
⦁ checkMatchSchedule(): This method will display the match schedule.
⦁ checkMatchSchedule():(): This method will display the match practice schedule.
⦁ rules(): display the sport rule.
Create the following classes:
⦁ Tennis, Cricket and football.
⦁ These classes will inherit the play class and override the parent methods.
Create a Player class:
⦁ playerId, name , height, weight, age.
⦁ checkMatchSch(): This method will take input from user inquiring which sport match schedule would he like to view and display the schedule of the respective Sport.
⦁ checkRules():This method will take input from user inquiring which sport rules would he like to view and display the rule of the respective Sport.
Create a Main class and test the methods.
Create a class name FunWithArrays and create the following methods:
⦁ consecutiveValueChecker(int arr[]): This method will not allow user to input consecutive values in an array
Input:
3,4,2,1,5,5
Output:
Cannot input consecutive value please input value other than 5
⦁ calcultesLongestSequence(String arr[]): This method will take a string array and calculate length of values at each index also print the word having the longest length
The following program is supposed to read two numbers from a file named Ex20Input.txt, and write the sum of the numbers to a file named Ex20Output.dat. However, it fails to do so. Rewrite the program so that it performs correctly. (You may assume that both numbers are on the same line.) import java.util.*; public class Ch3Ex20 { public static void main(String[] args) { Scanner inFile ¼ new Scanner(new FileReader("Ex20Input.txt")); int num1, num2; num1 = inFile.nextInt(); num2 = inFile.nextInt(); outFile.println("Sum = " + (num1 + num2)); outFile.close(); } }
Using a random number generator, create an array of 1000 integers. Apply bubble sort, insertion sort, selection sort, quick sort, and merge sort on that array. Calculate the execution time of sorting algorithms on the array. Write a report on the performance of these sorting algorithms based on your experimentation.
Write a Program that implements Base class calculator and a Derived class scientific calculator, The Derived class should take the basic operations i.e. add, divide, subtract from calculator. However it should have its own methods such as square, cube, and average and display method to display all these calculation for integer numbers. A main class with main method and create an object of base class and call the display method.
write a program that accepts as input the mass (in grams) and density (in grams per cubic centimeters), and ooutputs the volume of the object using the formula: density = mass / volume.
java linked list blackjack game
write a method called secondLargest that takes an array of integers and returns the second largest element in the array
write a method called insert that inserts an element into an integer array. It should take 3 parameters: an int array, the number to be inserted and the index it should be inserted at. It should return a new array that has the element inserted at the index (the new array should have a length 1 longer than the original array).