How can I write a Java program that shows these patterns by getting input from the user with character input and integer input.
****
***
**
*
*_*
*_ _*
*_ _ _*
also:
$$$$
$$$
$$
$
$$
$_$
$_ _$
$_ _ _$
$_ _ _ _$
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
How can I write a Java program that shows these patterns by getting input from the user with character input and integer input.
****
***
**
*
*_*
*_ _*
*_ _ _*
also:
$$$$
$$$
$$
$
$$
$_$
$_ _$
$_ _ _$
$_ _ _ _$
I have tried this much.
import java.util.Scanner;
/**This program displays a diamond pattern with the input gathered from user
*/
public class DiamondPattern {
public static void main(String[] args)
{
//Create a Scanner object for keyboard input.
Scanner keyboard = new Scanner(System.in);
//Get the character input from user.
System.out.print("Please enter what charecter you will be using?");
//Get integer input from user between 1-10.
System.out.print("Please enter the number for the size you want your diamond to be.");
}
}
Please read the announcements at the top of every forum to learn how to wrap code in the code tags.
Do you have a question?I have tried this much.