Question
This is for JAVA. For my assignment, I have to make a program that makes ASCII triangle shapes using either brackets or parentheses. If the
This is for JAVA. For my assignment, I have to make a program that makes ASCII triangle shapes using either brackets or parentheses. If the user enters an even number, the triangle will be made out of parentheses. If the user enters the program with an odd number, the triangle is made of brackets. However, in both cases, the user's number determines the height and width of the triangle. I can't use a scanner to get the input from the user. I have to use this code
int size = Integer.parseInt(args[0]);
so that the input is entered when the program is called.
I have tried doing this but I always get some errors. These are some examples of working programs:
>java DrawTriangle5 C 1 JC1 1 J JJI JC java DrawTriangle 6 C) CO COCOO CStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started