Question: Write a program that has the class name Problem1 and that has the main method. Leave the main method empty for now. Write a

Write a program that has the class name Problem1 and that has the main method. Leave the main method empty Problem 2. Define a class named Airport that has the following An instance variable named name of type String

Write a program that has the class name Problem1 and that has the main method. Leave the main method empty for now. Write a method named repeat Char that takes two parameters, an integer array arr and a character array ch, having the same length and returns a 2D array. Each row of the returned 2D array has each character from ch array, arr[i] times. Several sample usages are provided for you below. Use the sample usages in the main method to test your code (and use the print 2 DArray method to print out the results of calling the repeatchar method!). Sample Method Usage int[] x1 = {4, 3, 5, 2}; char[] y1= { 'Q', 'W', 'r', 'b'}; char[][] Z1 = repeatChar (x1, y1); z1 int[] x2 = {5, 2, 3, 4, 1}; char[] y2 = { '@', '!', ' Problem 2. Define a class named Airport that has the following An instance variable named name of type String An instance variable named capacity of type int An instance variable named rank of type int A constructor that takes no argument and sets name to "SkyFly", capacity to 3, and rank to 1. The constructor's header is Airport() A constructor that takes three parameters and sets the instance variables accordingly. The constructor's header is Airport(String newName, String newCapacity, double newRank) An instance method that displays the instance variables of the invoking object in a format of your choice. The method's header is void display Airport()

Step by Step Solution

3.31 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Problem 1 Problem1java public class Problem1 method that takes an int array and a char arr... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!