Question Details

Answered: - IST 140 Programming Assignment 9 (This is like Programming


I need help with the following code, please see attached instructions.


package patternmaker;


import java.util.Scanner;


public class PatternMaker {
???
??? public static void Main(String[] args) {
???????
??? }
???
??? public static String separatorString(Scanner in) {
??????? System.out.print("Please choose a separator string: ");
??????? String separatorString = in.next();
??????? return separatorString;
???????
??? }


??? public static String secondString(Scanner in) {
??????? System.out.print("Please enter the second string: ");
??????? String secondString = in.next();
??????? return secondString;
??? }


??? public static String firstString(Scanner in) {
??????? System.out.print("Please enter the first string: ");
??????? String firstString = in.next();
??????? return firstString;
??? }


??? public static String numColumns(Scanner in) {
??????? System.out.print("Please enter the number of columns you would like: ");
??????? String numColumns = in.next();
??????? return numColumns;
??? }


??? public static String numRows(Scanner in) {
??????? System.out.print("Please enter the number of rows you would like: ");
??????? String numRows = in.next();
??????? return numRows;
??? }
???????
}


IST 140

 

Programming Assignment 9 (This is like Programming Assignment 8, but requires the use of methods.)

 

1. Create, using NetBeans, a complete Java program called PatternMaker according to the following

 

guidelines.

 

The program prompts the use for five input values: an integer value between 1 and 10 (inclusive) for

 

the number of rows to be printed, a second integer value between 1 and 10 (inclusive) for the number

 

of columns to be printed, a string value for the starting string of the pattern, a string value for the

 

second string of the pattern, and a string value that separates the first two strings.

 

The program must use nested for loops to print a rectangular array of alternating first and second

 

strings of the pattern, separated by the separator string and such that the first string in the first row

 

uses the ?first string? provided by the user, but each subsequent row alternates the starting string

 

between the ?second string? the user provided and the ?first string? the user provided.

 

Use methods to accept the user input and to generate the program output. Your main program should

 

consist simply of a few variable declarations and method calls.

 

So, for instance, if the user enters 5 for the number of rows, 7 for the number of columns, and ?XX?

 

for the first string, ?OO? for the second string, and ?***? for the separator, your program should print

 

the following rectangular pattern.

 

XX***OO***XX***OO***XX***OO***XX

 

OO***XX***OO***XX***OO***XX***OO

 

XX***OO***XX***OO***XX***OO***XX

 

OO***XX***OO***XX***OO***XX***OO

 

XX***OO***XX***OO***XX***OO***XX

 

Thoughts:

 

*) Note the requirement for this program to use nested for loops (Horstmann section 4.3).

 

*) Note that there is no delimiter at the end of the lines.

 

*) The idea in this program is to effectively ?make into methods? the code you wrote for the

 

Programming Assignment 8. Assuming your code worked for the previous assignment, it should be

 

fairly straightforward to ?methodize? it for this assignment.

 

2. Export your project from NetBeans as a zip file (File ? Export Project ? To ZIP...) using the

 

following naming convention and then upload it to this lesson's drop box on ANGEL.

 

Naming Convention for zip file submissions to ANGEL: <PennStateAccessAccountID>.zip

 

So, for instance, if your Penn State Access Account ID is dag123, you would name your zip file

 

dag123.zip.

 

3. Use this lesson's Discussion Forum in ANGEL for questions about this assignment.

 


 

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 07, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now