CS110 Assignment 0 Basics and Installing Java and Eclipse


Part 1: Basic Programming Exercises

Important:






PROGRAM 1
Write a program that displays the hardware specs of your personal computer. Please keep this brief with no more than 3 lines of output.





PROGRAM 2
Write a program that displays the character pattern shown below.







PROGRAM 3
Write a program that displays the result of







PROGRAM 4
Write a program that displays the area and perimeter of a circle that has a radius of 5.5.
Tip:
  1. perimeter = 2 x radius x PI
  2. area = radius x radius x PI






PROGRAM 5
Assume that a runner runs 14 miles in exactly 3 hours. Write a program that displays the average speed in kilometers per hour.
TIP: 1 kilometer equals .6 miles.




PROGRAM 6
Assume that a runner runs 24.5 kilometers in 3 hours, 45 minutes, and 30 seconds. Write a program that displays the average speed in miles per hour.
TIP: Use 3.0, 45.0, and 30.0 for hours, minutes, and seconds. Also, use 60.0 for the number of minutes in an hour. This will be explained later.





PROGRAM 7
The US Census Bureau projects population based on the following assumptions: Write a program to display the expected popuation for the next year.
Assume the population for this current year is 312000000 and the number of days in the year is 365.





Part 2: Installing Java and Eclipse



Please read this section in its entirety before installing Eclipse.

Although you can use Eclipse in the Jones Computer lab, it is recommended that you install the Eclipse environment on your own computer. To write Java programs, you need two things: the Java Development Kit (JDK), and a source code editor. Please follow these directions before the first class, so you can get started writing code faster. The Java Development Kit contains the tools needed to compile and run Java programs. The source code editor lets you write programs, and has features to make this easier. For this course, you can use any tool you like, but we will be using Eclipse in the course.
The Eclipse installation process has two steps:

  1. Install Java SE Development Kit
  2. Install Eclipse

Below is a brief description of the installation process. If you get stuck, refer to youtube and google.


Install the JDK

    Step 1: Locate the correct JDK version to download.

    The JDK is a development environment for building applications, applets, and components using the Java programming language. One of the most important tools in the JDK is the Java compiler, used by the IDE and SDK for developing Java programs. The JDK also contains a Java Runtime Environment (JRE), which enables Java programs, such as Eclipse, to run on your system. Android requires the Java Development Kit (JDK). Visit the Java downloads page on Oracle's website to find the JDK environment download. Scroll down until you find the latest Java SE at the following address:
    http://oracle.com/technetwork/java/javase/downloads/index.html .


    Step 2: Download the JDK and accept the Oracle Binary Code License Agreement

    To complete the download, you must accept the Binary Code License Agreement. You will be provided with the various versions of the latest java SE. Select a download version that works with your operating system.
    Note: For Windows users, you will have to know what type of version of your OS you have. If your computer is a 64 bit Windows , select Windows 64 and if you have a 32 bit Windows, select Windows 32 bit. To view information about your operating system, right click Computer and select Properties.
    Notes:

    1. Once the download is complete, double click the file to begin the installation of the JDK. The installer file is an executable. Run the executable to install the JDK and you will be guided through the installation process.
    2. You may specify a different location of the JDK.
    3. Verify both JDK and JRE have been installed.


Install Eclipse

    Step 1: Locate the correct IDE version version to download.

    Eclipse is a general-purpose programming platform that provides programmers with an integrated environment for building applications. As an IDE it is used for writing, testing, and debugging your programs. An Eclipse package is a ready-made collection of Eclipse modules that make Eclipse better suited for certain kinds of software development. Download and install the Eclipse IDE for Java Developers at the following address:
    http://www.eclipse.org/downloads.


    Step 2: Extract Eclipse from the zip file

    Once you have downloaded the Eclipse archive you will need to decompress the zip file, which will create the unzipped Eclipse folder. Since Eclipse does not have any installer, there will be an executable file inside the Eclipse folder named eclipse. You can double click on the file to run Eclipse.


    Step 3: Confirm everything works

    Now that you have finished installing Eclipse, restart your computer. Restarting your computer refreshes system memory and allows registration or configuration changes made by installers and uninstallers to take effect. Write a test program.