Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program will be based on careers and median salaries from example careers for degress using the following format: Career MedianSalary where MedianSalary is listed

image text in transcribedimage text in transcribed

The program will be based on careers and median salaries from example careers for degress using the following format: Career MedianSalary where MedianSalary is listed as $##,### or $###,### You are to prompt the user to input career data until the user enters a blank line. The goal of the program is to find the title and salary for the career having the highest and lowest median salary. Your program must validate input, displaying invalid input with an appropriate message. Note: You cannot assume that the $ sign appears in a specific column, you must find it in the string. You must remove leading and trailing spaces from career, e.g., String has a trim() method. You will need to convert the string representation of the salary to one that can be converted to an integer using Integer.parseInt(string). Before calling, make sure that all characters are digits using Character. is Digit(ch). Test Cases: Careers: Leading spaces, no leading space Median Salaries: valid, missing $, missing comma, extra comma, not digits Enter median salaries in various orders: increasing order, decreasing order, unordered Line of data: both inputs, only career, only salary Sample Input and Output: $81,100 A ----GRASP exec: java Careers Please enter (title $salary): Database Architects $88, 510 Please enter (title salary): Network and Computer Systems Administrators Please enter (title salary): Computer Network Architects $104,650 Please enter (title $salary): NoSalaryTesti Invalid input - no $: NoSalaryTesti Please enter (title $salary): NoSalaryTest2 99,999 Invalid input - no $: NoSalaryTest 2 99,999 Please enter (title $salary): NoCommaTest $99999 Invalid input comma issue: NoCommaTest $99999 Please enter (title $salary) : ExtraCommasTest $999,999,999 Invalid input - comma issue: ExtraCommastest $999,999,999 Please enter (title $salary): $99,999 Invalid input - no title: $99,999 Please enter (title $salary): SalaryNotNumeric $123, bbb Invalid input - salary not integer: SalaryNotNumeric $123, bbb Please enter (title $salary): A Maximum Salary: 104650 for title: Computer Network Architects Minimum Salary: 81100 for title: Network and Computer Systems Administrators --GRASP: operation complete. L

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

decide what data to gather and when;

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago