Question Number 2 in JAVA: Please help! G CentralLink l Central Mic @ Take Test:
ID: 3717129 • Letter: Q
Question
Question Number 2 in JAVA: Please help!
G CentralLink l Central Mic @ Take Test: Lab 15B-Prob × ? Secure https://black oardcmich.edu webapps assessment take launch sp?course assessment id= 221 18 18 course id= 14088/ 1&content; id-56 3221 1&step;=nu Apps Home| Central Mich zy Central Michigan nFantay Foothall 201 C Hom IChegg.com System.out.printin(Character.isDigit('4');: /will print true System.out.printin Character.isDigitp)); will print false Submit Phone.java Attach File Browse My Computer QUESTION 2 5 points Save Answer Create a program named BorderChar which can print a patten with character as the border and whitespaces inside Specifically, create a method named printPattern which takes in the row and colomn as parameter, and print the pattern with specified row and column. Call the method in main method with the number of rows and columns to print. For example, if row7 and col-5, the pattern is as following Submit BorderCharjava Attach File Browse My Computer QUESTION 3 Optional) Bubble sort is a simple sorting algorithm to sort a list of numbers, e.g. an array. For example, given an array f5, 1, 4, 2. 8 and sort it to f 1. 2, 4, 5. 8) Use the starting code BubbleSort.java, implement the sorting method to sort an integer array O Type here to search 0 points Save Answer Mail has new messages 1053 AMExplanation / Answer
BorderChar.java
public class BorderChar {
public static void main(String[] args) {
printPattern(7, 5);
}
public static void printPattern(int row, int col) {
for(int i=1;i<=row;i++) {
for(int j=1;j<=col;j++) {
if(j==1||j==col||i==1||i==row){
System.out.print("#");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
Output:
#####
# #
# #
# #
# #
# #
#####
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.