我物流已经毕业了,拿了个AEC 的证,正在超这方面找工作,工作也不是很好找,但也感觉自己兴趣不是很大,真的找到工作怕也坚持不下来。所以就想着再学个别的专业。目前在看服装设计、Information System. 服装设计是自己喜欢的,但大家都说不好找工作。 Information System 不知道对数学的要求有多高,会不会很难。一头雾水,前路茫茫!
我物流已经毕业了,拿了个AEC 的证,正在超这方面找工作,工作也不是很好找,但也感觉自己兴趣不是很大,真的找到工作怕也坚持不下来。所以就想着再学个别的专业。目前在看服装设计、Information System. 服装设计是自己喜欢的,但大家都说不好找工作。 Information System 不知道对数学的要求有多高,会不会很难。一头雾水,前路茫茫!
我物流已经毕业了,拿了个AEC 的证,正在超这方面找工作,工作也不是很好找,但也感觉自己兴趣不是很大,真的找到工作怕也坚持不下来。所以就想着再学个别的专业。目前在看服装设计、Information System. 服装设计是自己喜欢的,但大家都说不好找工作。 Information System 不知道对数学的要求有多高,会不会很难。一头雾水,前路茫茫!
It may be easier for you, but it's darn harm for me to learn a coding language. I am learning Java programming right now. It's fucking hard to understand how to use the different loops and to write different methods. Shit, I don't know what to do for my weekly labs most of the time.
It may be easier for you, but it's darn harm for me to learn a coding language. I am learning Java programming right now. It's fucking hard to understand how to use the different loops and to write different methods. Shit, I don't know what to do for my weekly labs most of the time.
It may be easier for you, but it's darn harm for me to learn a coding language. I am learning Java programming right now. It's fucking hard to understand how to use the different loops and to write different methods. Shit, I don't know what to do for my weekly labs most of the time.
I am a new coding learner, C# is pretty hard for me too(it is a language quite similar to Java). so I decide to learn other back end language such as node.js.
Using the “base” character “*” write a program that presents the following menu to the user: Welcome to My ASCII ART: 1. I 2. L 3. T 4. Z 5. to quit
Please choose a letter you would like to see: Also, have the user enter an integer that indicates the height of the letter. The program will then output the ASCII Art version of the letter. You may make the letters just one * in width. Try these challenges: add more letters to the menu, allow the user to specify the width of the letters or try to make different shapes.
Using the “base” character “*” write a program that presents the following menu to the user: Welcome to My ASCII ART: 1. I 2. L 3. T 4. Z 5. to quit
Please choose a letter you would like to see: Also, have the user enter an integer that indicates the height of the letter. The program will then output the ASCII Art version of the letter. You may make the letters just one * in width. Try these challenges: add more letters to the menu, allow the user to specify the width of the letters or try to make different shapes.
I only know how to write the program with "for loop" to display the letter "I". so I know how to use the "for loop" for very very simply programs. Here is the program for the letter ''I".
public class ASCIIArt {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.print("Please enter a number to indicate how many stars: \n");
final int MAX_SIZE = 8;
int size = userInput.nextInt();
for (int i = 1; i <= size; i++) {
if (size <=MAX_SIZE){
System.out.println(" *");
}
else{
System.out.println("Invalid entry.");
}
}
How do you use the "for loop" to write the program to display the letter "Z". the height of the letter "Z" changes accordingly when the user enters different numbers.
I only know how to write the program with "for loop" to display the letter "I". so I know how to use the "for loop" for very very simply programs. Here is the program for the letter ''I".
public class ASCIIArt {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.print("Please enter a number to indicate how many stars: \n");
final int MAX_SIZE = 8;
int size = userInput.nextInt();
for (int i = 1; i <= size; i++) {
if (size <=MAX_SIZE){
System.out.println(" *");
}
else{
System.out.println("Invalid entry.");
}
}
How do you use the "for loop" to write the program to display the letter "Z". the height of the letter "Z" changes accordingly when the user enters different numbers.
I only know how to write the program with "for loop" to display the letter "I". so I know how to use the "for loop" for very very simply programs. Here is the program for the letter ''I".
public class ASCIIArt {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.print("Please enter a number to indicate how many stars: \n");
final int MAX_SIZE = 8;
int size = userInput.nextInt();
for (int i = 1; i <= size; i++) {
if (size <=MAX_SIZE){
System.out.println(" *");
}
else{
System.out.println("Invalid entry.");
}
}
How do you use the "for loop" to write the program to display the letter "Z". the height of the letter "Z" changes accordingly when the user enters different numbers.
I only know how to write the program with "for loop" to display the letter "I". so I know how to use the "for loop" for very very simply programs. Here is the program for the letter ''I".
public class ASCIIArt {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.print("Please enter a number to indicate how many stars: \n");
final int MAX_SIZE = 8;
int size = userInput.nextInt();
for (int i = 1; i <= size; i++) {
if (size <=MAX_SIZE){
System.out.println(" *");
}
else{
System.out.println("Invalid entry.");
}
}
How do you use the "for loop" to write the program to display the letter "Z". the height of the letter "Z" changes accordingly when the user enters different numbers.
第一版Java代码在下面,"Try these challenges: add more letters to the menu, allow the user to specify the width of the letters or try to make different shapes.", 留给你自己搞定,基本的原理都是一样的,只不过把字母的宽度也设置成变量,再和矩阵的列column数进行运算。
package asciiart;
import java.util.Scanner;
/**
*
* @author zw
* Version 1,0
*/
public class ASCIIArt {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner scanHeight = new Scanner(System.in);
System.out.print("Input the size of the height(better odd, larger than 2): ");
int height = scanHeight.nextInt();
LetterGenerator gen = new LetterGenerator(height);
Scanner scanOption = new Scanner(System.in);
System.out.print("Welcome to My ASCII ART: 1. I; 2. L; 3. T; 4. Z; 5. Quit: ");
int input = scanOption.nextInt();
switch(input) {
case 1:
gen.drawI();
gen.print();
break;
case 2:
gen.drawL();
gen.print();
break;
case 3:
gen.drawT();
gen.print();
break;
case 4:
gen.drawZ();
gen.print();
break;
case 5:
System.out.println("Bye!");
break;
default:
System.out.println("Invalid input!");
break;
}
}
}
代码:
package asciiart;
/**
*
* @author zw
*/
public class LetterGenerator {
private final int r;
private final String letter[][];
public LetterGenerator(int r) {
this.r = r;
this.letter = new String[r][r];
for(int i = 0; i < r; i ++) {
for(int j = 0; j < r; j ++) {
letter[j] = " ";
}
}
}
public void drawI() {
for(int i = 0; i < r; i ++) {
letter[r - 1] = "*";
}
}
public void drawL() {
for(int i = 0; i < r; i ++) {
for(int j = 0; j < r; j ++) {
if(i < r) {
letter[0] = "*";
}
if(j < r) {
letter[r - 1][j] = "*";
}
}
}
}
public void drawT() {
int mid = r / 2;
for(int i = 0; i < r; i ++) {
for(int j = 0; j < r; j ++) {
if(i < r) {
letter[mid] = "*";
}
if(j < r) {
letter[0][j] = "*";
}
}
}
}
public void drawZ() {
for(int i = 0; i < r; i ++) {
for(int j = (r - 1); j >= 0; j --) {
if(i == 0 || i == (r - 1)) {
letter[j] = "*";
} else {
letter[r - i - 1] = "*";
}
}
}
}
public void print() {
for(int i = 0; i < r; i ++) {
for(int j = 0; j < r; j ++) {
System.out.print(letter[j]);
}
System.out.println("");
}
}
}
我物流已经毕业了,拿了个AEC 的证,正在超这方面找工作,工作也不是很好找,但也感觉自己兴趣不是很大,真的找到工作怕也坚持不下来。所以就想着再学个别的专业。目前在看服装设计、Information System. 服装设计是自己喜欢的,但大家都说不好找工作。 Information System 不知道对数学的要求有多高,会不会很难。一头雾水,前路茫茫!