Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java please do all parts Question 2: Modify the program from lab 1 so that it prompts the user for a 5-digit positive integer with

Java please do all parts

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 disrtaxStar (int number) defined in the class Starfisrtax. (Note: Do not worry about invalid inputs.) import java.utiti Scanner; public class StarDisplayTest, { public static void main(String args[]) { Y. int a; Stardisptax s' = new Stardisplay(); //prompt the user to enter a 5-digit positive integer //and initialize the above variable a: Sedisplaystar(a); PART B: Modify the code below, complete the method displaystar(int number) to extract 5 digits and call displaystartetren (int i) to display them as a big banner. (Hint: you can extract these digits using the / and % operation) IL Y A ELLI ULUSUSLIK LET R UKKET PART C: Complete a method danaStarBaie int 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 :::: I Page 123 public class Steeplay public void donatorint number) ( //extract each duit from the passed parameter, and //call the method donat e ulint public void disahawla la reclint ut //display a banner based on the passed parameter

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions