Question
a. Write a program that reads two numbers from the keyboard representing, respectively, an investment and an interest rate (you will expect the user to
a. Write a program that reads two numbers from the keyboard representing, respectively, an investment and an interest rate (you will expect the user to enter a number such as .065 for the interest rate, representing 6.5% interest rate). Your program should calculate and output (in $ notation) the future value of the investment in 5, 10 and 20 years using the following formula
future value = investment*(1 + interest rate)^year
You will assume that the interest rate is an annual rate and is compounded annually.
b. Write a program that reads a commercial website URL, from the keyboard, you should expect that the URL starts with www. and ends with .com. Retrieve the name of the list and output it. For instance, if the user inputs www.yahoo.com, you should output yahoo.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started