CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  ·...

4
1 CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before lab. Read the “Java SE – JDK Installation Instructions " (found in Blackboard.) Install the JDK (Java Development Kit) on your own computer. You probably have some version of the JRE (Java Runtime Environment) already installed, but that is not sufficient for programming in Java. All: To use java/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 “MyFirstProgram.java” using Wordpad (Windows) or TextEdit (Mac) and compile it using javac in the MS-DOS window / or MAC Terminal window. Execute it using the “java” command in the MS-DOS window / or MAC Terminal window. 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.

Transcript of CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  ·...

Page 1: CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  · 2013-08-28! 1! CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before

  1  

CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before lab. Read the “Java SE – JDK Installation Instructions " (found in Blackboard.) Install the JDK (Java Development Kit) on your own computer. You probably have some version of the JRE (Java Runtime Environment) already installed, but that is not sufficient for programming in Java. All: To use java/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 “MyFirstProgram.java” using Wordpad (Windows) or TextEdit (Mac) and compile it using javac in the MS-DOS window / or MAC Terminal window. Execute it using the “java” command in the MS-DOS window / or MAC Terminal window.

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.

Page 2: CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  · 2013-08-28! 1! CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before

  2  

NOTE: If you are not bringing a laptop to your lab session, bring a copy of the program you typed to the lab session with you so you don't have to retype it. (e.g., On a memory stick, or by emailing it to yourself.) LAB - Syntax Errors and Productivity Software [90 points]

1) [10 points] Compile Error (Word Document) Start with the program you typed and compiled. Remove the first curly brace ({) 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 MS Excel or OpenOffice Calc) with solutions to four

algorithm problems. You may include all four solutions in one spreadsheet. 2A) [25 points] Salary Planner (Excel Spreadsheet) Create  a  spreadsheet  which  calculates  the  salary  for  each  year  for  a  decade,  using  a  starting  salary  of  30,000  and  an  annual  raise  of  3%.    Also  show  the  annual  salary  adjusted  for  inflation  using  the  inflation  rates  shown  below.   Match the output shown below ê

Page 3: CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  · 2013-08-28! 1! CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before

  3  

2B) [10 points] Area and Circumference of a Circle (Excel Spreadsheet)

Calculate the area and the circumference of a circle of any given value of diameter. Allow the user of your spreadsheet to enter any value for diameter of a circle and compute and display the area and the circumference of the circle. (estimate pi using the result of 22/7)

2C) [25 points] Computing Discounts (Excel Spreadsheet)

During a special sale at a store, a 10% discount is taken on purchases over $10.00. Write a program that asks for the amount of purchases, then calculates the discounted price. Also include the sales tax (8.75% rate) and the total due. (See sample output below.) Sample Output:

HINT: You’ll need to use “If” function. =if(boolean-expression, [value-if-true], [value-if-false])

Page 4: CSE1341 - Lab Assignment for Week 2 - Southern …devans/1341/Lab 01 - CSE1341 - F… ·  · 2013-08-28! 1! CSE1341 - Lab Assignment for Week 2 PRE-LAB [10 points] Must be done before

  4  

2D) [20 points] Planetary Weight (Excel Spreadsheet)

The gravitational pull is different than each of the planets in our solar system. Use the Internet or another source to determine the gravity factor of each of the other 8 planets (including Pluto) relative to Earth. Create a spreadsheet that allows the user to enter their weight on Earth and displays the equivalent weight on the other 8 planets.

Submit the document and spread sheet via Blackboard (as a single zip-file). This assignment is due by 6:00AM on Wednesday, September 11.