Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

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

Students also viewed these Databases questions

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago

Question

Prepare for a successful job interview.

Answered: 1 week ago

Question

Describe barriers to effective listening.

Answered: 1 week ago

Question

List the guidelines for effective listening.

Answered: 1 week ago