Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2: Modify the program from lab 1 so that it prompts the user for a 5-digit positive integer with any number of digits up
Question 2: Modify the program from lab 1 so that it prompts the user for a 5-digit positive integer with any number of digits up to 9. The program should then display their integer as a big banner. PART A: Modify the below test class StarDisplayTest so that it can prompt the user to enter a 5-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 f public static void main (String args[]) int a; StarDisplay s = new StarDisplay( ); //prompt the user to enter a 5-digit positive integer //and initialize the above variable a: s.displayStar (a) 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
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