$25
Read the “Java SE – JDK Installation Instructions " (found in Appendix A in the textbook, or provided by the instructor.) Install the JDK (Java Development Kit) on your own computer.
All: To use java and javac from the command line
Mac: Spotlight: Terminal
Windows*: Start->Run... and enter cmd
All operating systems: Type the program below into a file name “FirstProgram.java” using Notepad (Windows) or TextEdit (Mac) and compile it using javac in the Windows CMD window / or Mac Terminal window. Execute it using the “java” command in the Windows CMD window / or Mac Terminal window. Mac users – see the note at the end of this document regarding settings in the TextEdit app.
If this compiles and executes correctly your installation of Java was successful. If you experience problems, bring your laptop to the lab and ask for help.
LAB - Syntax Errors and Productivity Software [90 points]
1) [10 points] Start with the program you typed and compiled. Remove the two semi-colons (;) and try to compile your program. Paste the program and the error message into a word/open office document and explain what this message means.
2) Create a spreadsheet with solutions to the following four algorithm problems:
2a) [20 points] – The Fibonacci sequence is a pattern of integers starting with zero and one, where each subsequent value is equal to the sum of the prior two values:
Fn = Fn-1 + Fn-2, where F0 = 0 and F1 = 1.
Create a spreadsheet which contains the first two numbers of the Fibonacci sequence, and calculates each the next 25 values:
2b) [20 points] – World Population
The total world population was estimated at 7.6440 billion people in August 2018. Assuming an annual growth rate of 1.09% per year, create a spreadsheet showing the world population in 2018 and for each of the next 25 years. Hint: if calculated properly, the U.S. population in 2043 would be 10.0236 billion people.
2c) [20 points] – Customary unit conversion.
Create a spreadsheet that converts the following:
1. Liter to gallon
2. Gallon to liter
3. Kilometers to miles
4. Miles to kilometers
The conversion formulas:
1 liter
=
0.264172 gallon
1 gallon
=
3.78541 liters
1 kilometer
=
0.621 mile
I mile
=
1.609 kilometers
Use the following sample data in your spreadsheet - for grading purpose.
2d) [20 points] – Compound Interest Calculator
The formula for annual compound interest, including principal sum, is:
A = P (1 + r/n) (nt)
Where:
A = the future value of the investment/loan, including interest
P = the principal investment amount (the initial deposit or loan amount) r = the annual interest rate (decimal)
n = the number of times that interest is compounded per year t = the number of years the money is invested or borrowed for
Assume you put $120,000 into a bank. How much will your investment be worth after 15 years at an annual interest rate of 4% compounded quarterly? How much will be the total interest earned?