Lab Exercise 1 solution

$19.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Overview • This lab exercise has two objectives • 1) Updating your Java and Eclipse installations to Java 8, update 65, and Eclipse Mars • 2) Reviewing topics from Introduction to Programming by creating a simple calculator Tasks 1) Update Java JDK o Using the Windows Control Panel Un-install Java 7, this includes both the JDK and JRE o Locate and Delete your Eclipse folder (Note: This is not the workspace folder) *** If in doubt make a back up copy of your workspace to a USB drive, or another folder on your hard drive and ask your professor for help*** o Download Java 8 update 65 from this link:  http://www.oracle.com/technetwork/java/javase/downloads/index.html o Download Java 8 documentation from this link:  http://www.oracle.com/technetwork/java/javase/downloads/index.html  (This is the same link, scroll down in the web page just below “Additional Resources” o Download Eclipse Mars from this link:  http://eclipse.org/downloads/  Get the “Eclipse IDE for Java Developers” (Not the EE version) o Install Java 8 o Update your System Environment Path variable for the Java 8 update 65 install.  JAVA_HOME should be C:\Program Files\Java\jdk1.8.0_65 o Unzip the documentation o Unzip the Eclipse folder and move it to a location of your choosing Be prepared to show start up of Eclipse Mars, as well as use java –version, and javac –version in a console to the lab professor who will verify Java 8 and Eclipse Luna is installed. 2) Create a simple Calculator • Write the program for a simple Calculator. The program should prompt the user to enter a number from 1 to 4 for the arithmetic operation to perform, then request two numbers, and finally display the numbers entered as well as the result on screen. You may write the entire program procedurally within a single main method, or take a more object-oriented approach. (Future exercises and assignments will require an object-oriented approach.) Note: Output from the program should have numbers formatted with 2 decimal places.
Example of using the program, bolded highlighted digits are user input Please enter an option: 1 Addition 2 Subtraction 3 Multiplication 4 Division 4 Please enter number 1:1 Please enter number 2:2 1.00 / 2.00 is 0.50 Grading Task Points javac –version reports Java 1.8 update 65 (or newer)? java –version reports Java 1.8 update 65 (or newer)? Eclipse Mars installed? 2 2 1 Calculator program compiles and works as expected 5 Total 10