Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- A package named edu . westga. cs 6311 . lab07 .model. This package will include a class named Pattern. This class will contain: Instance
- A package named edu . westga. cs 6311 . lab07 .model. This package will include a class named Pattern. This class will contain: Instance variable that holds a number of lines - A 1-parameter constructor (be sure to include appropriate error checking) Getter method for the instance variable A private, helper method called getLine. This method will accept an integer holding the line number. It will return a String holding a series of numbers in the following order: The line will start with the line number. It will then include every integer counting down to 1 . Finally it will include every integer counting back up to the line number. Be sure to include a single blank space between every number. For example, if this method were called with the line number 4 , then the result would be the String: 4321234 A method named getpattern. This method will not accept any values and will return a String holding the complete pattern of lines from 1 to the number stored in the instance variable. For example, if the instance variable is holding the number 5 , then this method will return the string: 12123223432124543212345 Hint: please use System. Iineseparator () so that you can break up the individual lines in the output - A package named edu.westga.cs 6311 . lab07. view. This package will contain a class named Patternview that defines a void method run. This method will: Prompt the user to enter the number of lines Use the object to call getPattern and display it on the screen. - A package named edu.westga.cs6311. lab07. controller. This package will contain a class named Driver with a main method. The main method should: Create an instance of Patternview Use that object to call the run method
Step 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