Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Goal : The lab was designed to teach you more about parameters. Lab Description : Take a letter and a box size, pass these

Lab Goal : The lab was designed to teach you more about parameters. Lab Description : Take a letter and a box size, pass these values as parameters to a method that will draw a box with size X size letters. Sample Input : A 8 x 2 S 6 Sample Output : Enter the letter for the box :: A Enter the size of the box :: 8 AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA

Enter the letter for the box :: x Enter the size of the box :: 2 xx xx

Enter the letter for the box :: S Enter the size of the box :: 6 SSSSSS SSSSSS SSSSSS SSSSSS SSSSSS SSSSSS

lab08b.java LetterBoxes.java

Hint: to convert a string to a char, just use the charAt(0) String bob = "h"; char cbob = bob.charAt(0); You will need this in the main method

//Name - //Date - //Lab - import java.util.Scanner; import static java.lang.System.*; class LetterBoxes { public LetterBoxes() { } public void printBox(char letter, int size) { } }
//Name - //Date - //Lab - import java.util.Scanner; import static java.lang.System.*; public class lab08b { public static void main( String args[] ) { //loop 3 times //ask the user to enter letter (must be a String) //ask the user to enter a size //find the first character of the String //instantiate a LetterBoxes object //print the LetterBoxes object out.println ("program completed by: your name here"); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

1. Explain why evaluation is important.

Answered: 1 week ago