Question: Do programming problem Chapter 8 : 1 ) and 2 ) , Chapter 9 : 2 ) Chapter 8 Hello Write a program that greets

Do programming problem Chapter 8: 1) and 2), Chapter 9: 2)
Chapter 8
Hello
Write a program that greets the user with "How are you?" If the response is "OK"(upper- or lowercase), then display "Good to hear!" Handle
(ignore) leading and trailing spaces. Useful string methods are lower() or upper() and strip().
Example run:
How are you? OK
Good to hear!
Integer Check
Write a program that prompts the user to enter an integer and then checks if the entry is an integer. For this problem, do not use try/except;
instead, use string methods. As part of your program, define a function is Integer(s that has a string parameter s and returns True or False.
Useful methods to consider are strip() and isdigit().
Example run:
Please enter an integer: 123x
That isn't an integer
Chapter 9
Country Statistics Lookup-Multiple Measures
Assume a program begins with the statement:
allData
'US': {'pop':325.7,'gdp': 19.39,'ccy': 'USD', 'fx': 1.0},
'CA': {'pop': 36.5,'gdp': 1.65,'ccy': 'CAD', 'fx': 1.35},
'MX': {'pop':129.2,'gdp': 1.15,'ccy': 'MXN','fx': 19.68}
}
Write subsequent statements that (in a loop) prompt the user for a country code (US, CA, or MX), then prompt for a
measure name (pop, gdp, ccy, or fx), then look up in the above dictionary for the corresponding value, and display that value.
Example run:
Please enter a country code: CA
Please enter a statistic: pop
CA pop =36.5
Your program should handle the cases where a user-entered country code or measure name is not found.
 Do programming problem Chapter 8: 1) and 2), Chapter 9: 2)

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!