Question: I want a complet program for question a Question 4 (a) The method inputstring(String prompt) of a class Salary has already been written and you

I want a complet program for question a I want a complet program for question a Question 4 (a) The

Question 4 (a) The method inputstring(String prompt) of a class Salary has already been written and you can use it difectly. It prints the string prompt. which asks for tuser input, and returns the inpot as a string. Write a Java program segment (assuming it is in a method of the class Salary) using the method inputstring() to display the message "Input a positive salary" and get the user input. You should ask again until the input is positive or the user has already tried 10 times. Finally the score should be stored in a variable salary (of type int). which is set to zero if the aforementioned number of times has been reached but the inpot is still not positive. You can assume the user always input a valid integer. (b) Using a switch/case statement, assign a suitable string to the variable rank (of type Stringl acconfine to the followine conditions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!