Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

What is a new-venture team?

Answered: 1 week ago

Question

=+2. Where is your key public located geographically? 3

Answered: 1 week ago