Question: Can someone please run this through Java and make sure I have done this correctly? I can't get #10 to return as a string but

Can someone please run this through Java and make sure I have done this correctly? I can't get #10 to return as a string but I would rather the code run without errors or at least be correct unless you can fix it. I will rate any helpful answers or answers with corrections to my code!

import java.util.*;

public class Assignment05 { public static void main(String[] args) { System.out.println("Dylan Zurfluh Assignment 5"); }

9.Write (define) a static method named maxStringOfStars, that takes two String arguments. When this function is called, it should return a String of asterisks (*) that is the same length as the longest string argument passed to it.

10.Write (define) a static method named midStringOfStars, that takes three String arguments. When this function is called, it should return a String of asterisks (*) that is the same length as the string argument with the length that would be in the middle if the lengths of the arguments were arranged in ascending order.

//9) Write (define) a static method named maxStringOfStars, public static String maxStringOfStars(String a, String b) { int len_a; int len_b; Scanner scan = new Scanner(System.in); System.out.println("Please enter your two inputs for your average length calculation."); System.out.println("Value 1: "); a = scan.next(); System.out.println("Value 2: "); b = scan.next(); //find lengths of strings len_a = a.length(); len_b = b.length(); //set up if else to direct flow if(len_a > len_b) { String string=""; for(int i=0;i len_c) { String string=""; for(int i=0;i len_b && len_a < len_c) { String string=""; for(int i=0;i len_a && len_b < len_c) { String string=""; for(int i=0;i len_c) { String string=""; for(int i=0;i len_a && len_c < len_b) { String string=""; for(int i=0;i len_b) { String string=""; for(int i=0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!