哪位高手帮我坐下Java的题目啊,感激~!

来源:百度知道 编辑:UC知道 时间:2024/07/07 01:30:12
1. Write a textBox() method that takes two string parameters and prints a box around the
first string. The first parameter is the string of text to be displayed; the second string
is the character to be used for the box.
The length of the top and bottom lines of the box is to be determined by
using the length() method
• Display the text string ‘My name is: <your name goes here>’ by calling the
textbox() method. You are to use your own name (in pinyin), however, your
name is to be stored as a variable, and that variable is to by used when
displaying the ‘My name is:’ line
• You can choose any character to be the box around the text
2. Write a randBetween() method that asks the ‘user’ to enter an integer via the
keyboard (the maximum integer value is 2,147,483,647 – see page 71). Display the
request using the textbox() method.
Then using the random class, generate a number between 1 and the nu

public void textBox(String myName,String s2){
int length=((“My name is:”+myName).length()+s2.length()*2);
for(int i=0;i<length/s2.length()+3){
System.out.print(s2);
}
System.out.println();
System.out.print(s2+" ");
System.out.print("My name is:"+myName);
System.out.println(" "+s2);
for(int i=0;i<length/s2.length()+3){
System.out.print(s2);
}
}
你的题目要求就是打印自己的名字 在一个BOX里面

哇,好长啊

你可以 作业题目都发上来了

awerawr