move just public, not public Rectangle?
Type: Posts; User: aw20
move just public, not public Rectangle?
import java.util.Scanner;
/*
* Stacktrace.in
* You have a exception , we have a solution
*/
public class DrawRectange {
public static void main(String[] args) {
no I like to learn myself and use your help
You can do that? write the code for someone esle?
All i need is example of loops controls
for (int j= 3; j <= height; j++) {
}
if (i%width) == 3)
System.out.print("#####");
or
Ok
--- Update ---
What should I say in if statement for height?
Tell me what I should do?
or if (width < 1 || width >10 ?
I am attempting this myself
--- Update ---
public void draw(){
for(int i = 3; i < width; i++){
}
for(int j = 5; j < height; j++){
yes i did but can you give me a hint about the code?
Like this?
public void draw(){
for(int i = 0; i < width; i++){
System.out.print("#");
}
System.out.print("# #");
}
of replace the print("****")
with a loop to print width number of "*"
and to add with print("*")
a loop to print width-2 spaces followed by print("*")
Can you give me an example
Like this:
for (int j= 3; j <= height; j++) {
}
if ((x>0&&x<height-1)&&(y>0&&y<width-1)){
System.out.print("# "); {
}else...
ok
--- Update ---
public void draw(){
for(int i = 3; i < width; i++){
}
System.out.println("#");
Can you show me?
yes, that is what I mean. Sorry for confusion. The output for the rectangle look like :
COP 2253, Workshop6. This program written by Angel Williams
###
# #
###
#####
# #
# ...
Yes, i do. Is my code that I wrote right? and how can I drew the method in rectangle?
Write a Java class definition for class Rectangle. Each object of this class has the following variables:
height : an integer value representing height.
width : an integer value representing width....