Question: ISM3230 Individual Assignment 3-Conditional Logic Spring 2019 You are developing an application for an investment company that needs to categorize investment opportunities for sovereign debt

 ISM3230 Individual Assignment 3-Conditional Logic Spring 2019 You are developing an
application for an investment company that needs to categorize investment opportunities for
sovereign debt (i.e., debt owed by a central government, such as US
Treasury Bonds), and assign credit ratings based on the country's financial attributes,

ISM3230 Individual Assignment 3-Conditional Logic Spring 2019 You are developing an application for an investment company that needs to categorize investment opportunities for sovereign debt (i.e., debt owed by a central government, such as US Treasury Bonds), and assign credit ratings based on the country's financial attributes, and related information, This assignment is based loosely on the following research paper: Constantin Mellios & Eric Paget-Blanc (2006) Which factors determine sovereign credit ratings?, The European Journal of Finance, 12:4, 361 The table below summarizes the data used to describe countries: Country DescriptorInput Type Per-capita income Integer Tax revenue as a Range of Expected Values 681 to 124,927 Name How much income does the average person in the c How much of a country's income comes from taxes? Rate of change of prices in a How widely does the country's exchange rate earn? Double 1.4% to 75.82% of GDP Inflation rate Variability of exchange rate History of default Double Text .5 to 4,000,000 Low, Medium, High Text Yes or No Has the country defaulted on debt in the Integer 100 (fully transparent) Index of a country's transparency and to 0 (fully corrupt) Perception Index core governance structures The inputs into the application are data points describing the country, and the output is a three- character credit rating. The relevant decision tree is given in the figure below NHay of delaut 1 Rating MA Rating AAC 32 and 48 Rang Rating ccC Rating BBt Rating BBC Rating Be0 Your task will be to follow the decision tree above to assign credit ratings to countries. Things you must make sure you do in your code: Use nested conditional statements to encode the decision tree Use only the nextLine () Scanner method to read input from the user. This will avoid the issue with the extra new line character when reading text after numbers with nextint() or nextDouble(). The nextLine ) method will produce a String from the input. You should use the hints for handling input below to convert from String to numeric data. Compute all the conditional logic, and then print the rating. Use only one printin to print the rating at the end of your program. Do not print ratings from inside your conditional logic. Make sure your prompts and output messages match the sample output. o o o o Things you may not do in your code: Your classification routine will be only a small part of a larger program, so you may not use the System.exit ) or any similar method to terminate any of the conditional logic branches. Do not test for the same condition more than once, i.e., in the nested-else-if" section do not test what you already tested in the "if" above. o o Hints for handling input: o For text-based country data: Test only on the basis of the first letter of each choice. For example, if you are expecting "Yes" or "No" responses, you should use only the first character in differentiating the responses. (All text responses have different starting characters for any given decision point to make this possible.) Accept both upper- and lower-case letters for each choice. Consider the String method equalsIgnoreCase (String) for text comparisons, or use case conversion methods to convert to upper or lower case For simplicity, you do not have to do error checking of user input. If the user enters unexpected text values (eg" instead of Y or "N"), your code may (depending on how you have implemented it) assign the default rating, or assign no rating, or give a runtime error. This is ok. You are not responsible for errors in these cases. o For integer country data The nextLine () method will return a String. To convert from String to integer, use the Integer-parseInt (String) method. Example: " .String numberAsString "3940 . int numberAsint- Integer.parselnt(numberAsString) o For floating.point country data: The nextLine method will return a String. To convert from String to double, use the Double.parseDouble (String) method. Example: .String numberAsString-"3.61"; . double numberAsDouble Double.parseDouble(numberAsStringl: 1. Declare a rating variable as a String, and initialize it as needed. Do this before starting the conditional logic 2. Create a Scanner object for reading values from the keyboard. Do this before starting the conditional logic-you can create the Scanner variable once at the top of your code, and reuse the same Scanner variable for reading all the values throughout your conditional logic. You should not create multiple Scanner objects throughout your code. Prompt the user for country name and store it in a variable. At the end of your classification, print the country name to the screen before you print the rating. Prompt the user for country information, store it in appropriate variables, and use the values to make decisions. Nest your conditional logic appropriately to reach each decision point. Ask for the input only if it is relevant to the situation, for example, do not ask for the history of default if the country has a per-capita income above 50,000. 3. 4. First, prompt the user to enter the country's per-capita income, and read the input. Store in a variable and make a classification decision. a. Hint: Assume that one of the options is a default. Check for the first 2 of the 3 options, and assume it is the 3rd option as a default if the input does not match either of the first 2. b. When appropriate, prompt for history of default, and read the input. Store the input in a variable, and make a classification decision. When appropriate, prompt for tax revenue as a percentage of GDP, and read the input. Store the input in a variable, and make a classification decision. When appropriate, prompt for inflation rate, and read the input. Store the input in a variable, and make a classification decision. When appropriate, prompt for Corruption Perception Index score, and read the input. Store the input in a variable, and make a classification decision. When appropriate, prompt for variability of exchange rate and read the input. Store the input in a variable, and make a classification decision. c. d. e. f. 5. After the classification task is done, you should have a rating variable set to the appropriate credit rating for the input values. Print the credit rating, following the sample output. The print

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!