PART A: Modify the below test class StarDisplayTest( ) so that it can prompt the
ID: 3787306 • Letter: P
Question
PART A: Modify the below test class StarDisplayTest( ) so that it can prompt the user to enter a 5-9 digit positive integer, and pass the integer as a parameter to the method displayStar(int number) defined in the class StarDisplay. (Note: Do not worry about invalid inputs.)
import java.Util.Scanner; public class StarDisplayTest {
Page |3/5
}
PART B: Modify the code below, complete the method displayStar(int number) to extract 5 digits and call displayStarHelper(int i) to display them as a big banner. (Hint: you can extract these digits using the / and % operation)
PART C: Complete a method displayStarHelper(int i) so that it can display a digit passed as the parameter. (Hint: You can use IF statement to display the digit as a banner.)
For example if the user enters 52612 the program should display:
** ******** ** ******** ** ** ** ** ** ** ******** ** ******** **
******** ** ******** ** ** ** ** ** ** ** ** ******** ** ********
************** ************** ** ** ** ** ** ** ******** ** ******** **
******** ** ******** ** ** ** ** ** ** ** ** ******** ** ********
public class StarDisplay {
public void displayStar(int number){
} }
Explanation / Answer
PARTA:
PARTB:
PARTC :
Please explain me the example 52612 relation with the banner in comments.Then I will surely write the code.I am unable to understand the relationship of number and banner
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.