Then create a new Java application called "RecursiveTriangle" (without the quotation marks) according to the following guidelines.
EXAMPLE: The call to printTriangle(numLines, pattern) should print the following, assuming numLines has the value 4 and pattern has the value “[]”.
[][][][] [][][] [][] []
MUST BE IN JAVA
By the following guidelines of the data given
import java.util.Scanner ;
public class Recursive Triangle
{
public static void main(string [] args)
{
int numLines = getNumber();
string pattern = getString();
printTriangle(numLines, pattern);
}
public static void printTriangle (int numLines, string pattern)
{
if(numLines = = 0)
{
return;
}
else
}
printRowpattern( numLines, pattern);
System.out.println();
printTriangle(numLines-1, pattern);
}
}
public Static void print RowPattern(int numLines, String pattern)
{
if(numLines == 0)
{
return;
}
else
{
System.out,print(pattern);
printRowPattern(numLines-1, pattern);
}
}
public static int getNumber()
{
scanner scan = new Scanner(system.in);
system.out.println("Enter the number of lines ( between 1 and 10): ");
return scan.nextInt();
}
public static String getString()
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string:");
return scan.next();
}
}
OUTPUT
Enter the number of lines (between 1 and 10)
4
Enter the string:
[]
[] [] [] []
[] [] []
[] []
[]
SCREENSHOTS:


OUTPUT:

Then create a new Java application called "RecursiveTriangle" (without the quotation marks) according to the following...
create a new Java application called "RecursiveTriangle" (without the quotation marks) according to the following guidelines. Modify the example in Horstmann Section 5.9, pp. 228-230 so that the triangle displays “in reverse order” as in the example below, which allows the user to set the number of lines to print and the String used for printing the triangle. Use a method to prompt the user for the number of lines (between 1 and 10) to print. This method should take...
create a new Java application called "WeightedAvgDataAnalyzer" (without the quotation marks), that modifies the DataAnalyzer.java in Horstmann Section 7.5, pp. 350-351 according to the specifications below. The input file should be called 'data.txt' and should be created according to the highlighted instructions below. Note that even though you know the name of the input file, you should not hard-code this name into your program. Instead, prompt the user for the name of the input file. The input file should contain...
create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines. ** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. ** Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the...
I've been assigned to create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines. ** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. ** Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the...
create a new Java application called "WeightedAvgWithExceptions" (without the quotation marks), according to the following guidelines and using try-catch-finally blocks in your methods that read from a file and write to a file, as in the examples in the lesson notes for reading and writing text files. Input File The input file - which you need to create and prompt the user for the name of - should be called 'data.txt', and it should be created according to the instructions...
Write a complete Java program called "AtmSimDoLoop" (without the quotation marks) according to the following specifications. It should use a do-while loop to prompt the user with the following starting prompt (without the horizontal lines) until the user enters 4 to quit. The program should start with an initial account balance, which you can set to any legitimate double value. Prompt the user with the following prompt (without the horizontal lines). Enter the number of your desired transaction type. Deposit...
create a new Java application called "MinMax" (without the quotation marks) that declares an array of doubles of length 5, and uses methods to populate the array with user input from the command line and to print out the max (highest) and min (lowest) values in the array.
create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows. Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line. Use a method containing a nested for loop to compute the average of the doubles in each row. Use a method to...
I need java code for the following problem.
Lab 7: Methods 1. Write a Java program called Numbers that calls the following methods and displays the returned value: Write a method called cubelt that accepts one integer parameter and returns the value raised to the third power as an integer. o Write a method called randominRange that accepts two integer parameters representing a range. The method returns a random integer in the specified range inclusive. 2. o Write a method...
Within DrJava, create a class called StudentQuizScores and do the following using a do-while loop. 1. You program will read in a student’s first name. The same will be done for the student’s last name. Your program will use respective methods (described below) to accomplish this. 2. Your program will then read in three quiz scores, respectively. This should be done by using the same method three times. This method is described below. 3. Your program will then calculate the...