Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The "Create_rectangal_with_cahangable_values" class.
- // William-Godkin_ICS201
- import java.awt.*;
- import hsa.Console;
- public class Create_rectangal_with_cahangable_values
- {
- static Console c; // The output console
- public static void main (String[] args)
- {
- c = new Console ();
- //declare vareiables
- int leangth, width;
- //input values
- c.print ("Enter in the leangth (>1) ");
- leangth = c.readInt ();
- c.print ("Enter in the width (>1) ");
- width = c.readInt ();
- c.println ("The leangth is " + leangth + "and the width is " + width);
- c.print (" ");
- for (int counter = 1 ; counter <= leangth ; counter++)
- {
- c.print ("_");
- }
- c.println ("");
- for (int counter = 2 ; counter <= width ; counter++)
- {
- c.print ("|");
- for (int counter2 = 1 ; counter2 <= leangth ; counter2++)
- {
- c.print (" ");
- }
- c.println ("|");
- }
- c.print ("|");
- for (int counter = 1 ; counter <= leangth ; counter++)
- {
- c.print ("_");
- }
- c.println ("|");
- c.println ("So there you hve it the rectangle and the leangth and the width.");
- } // main method
- } // Create_rectangal_with_cahangable_values class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement