Skip to content

Latest commit

 

History

History
125 lines (96 loc) · 5.6 KB

File metadata and controls

125 lines (96 loc) · 5.6 KB

Exercise 1

Task 1 - Print "Hello, World!"

Configuring Visual Studio Code for Java Development (EEE Lab and vLab Machines)

The EEE lab machines have the Java Runtime Environment (JRE) installed on the "Shared Drive". To allow the use of Visual Studio Code for programming in Java we need configure Visual Studio Code to use the JRE on the "Shared Drive" and install some plugins.

Below are some steps to run a Windows script to automatically configure the correct JRE path and install the necessary plugins for you.

Important

These steps are only for working on the QUB EEE lab and vLab machines

Warning

These steps will have to be repeated every time you log onto a new QUB EEE lab or vLab machine

  1. Open "Google Chrome" by double clicking on the Desktop icon:

  1. Go to /~https://github.com/dlim04/fundamentals-of-programming-for-engineers-labs/ and click dlim-configure-vscode-java.bat:

  1. Click the "Download raw file" button:

  1. Wait for the file to download and then open the file:

  1. Click More info:

  1. Click the "Run anyway" button:

  1. A terminal window should appear. Wait for the script to output "Complete!" and then press any key to close the teminal window:

You have now successfully configured Visual Studio Code for Java development.

Creating a Java Project and Running "Hello, World!"

  1. Open "Visual Studio Code":

  1. A "Getting Started with VS Code" tab may appear. Scroll down and click Mark Done:

  1. Click the "Explorer" button:

  1. Click the "Create Java Project" button:

  1. Click No build tools

  1. A window will appear asking you to select a location to create your Java project folder. In my case I chose to create a fundamentals-of-programming-for-engineers-labs folder in my Documents folder. If you wish to save your lab work across machines you may wish to choose the I: drive as the location to create your Java project folder. Click the "Select the project location" button:

  1. Type a name for your Java project and press the "Enter" key. Here I have chosen the name lab-1:

  1. Click src (shorthand for source) in the "Explorer" sidebar:

  1. Open App.java by clicking it:

  1. Click the "Run" button:

  1. A terminal should appear with "Hello , World!" printed in it:

You have successfully run "Hello, World!" in Java.

Task 2 - Penguin

  • Print the following penguin:
                         4MMMMMMMMMMMML
                       4MMMMMMMMMMMMMMMML
                      MMMMMMMMMMMMMMMMMMML
                     4MMMMMMMMMMMMMMMMMMMMM
                    4MMMMMMMMMMMMMMMMMMMMMML
                    MMMMP   MMMMMM   MMMMMMM
                    MMMM MM  MMM  MM  MMMMMM
                    MMMM MM  MMM  MM  MMMMML
                     MMM MP,,,,,,,MM  MMMMMM
                      MM,"          "MMMMMMP
                      MMw           'MMMMMM
                      MM"w         w MMMMMMML
                      MM" w       w " MMMoMMML
                     MMM " wwwwwww "  MMMMMMML
                   MMMP   ".,,,,,,"     MMMMMMMML
                  MMMP                    MMMMMMMML
                MMMMM                      MMMMMMMML
               MMMMM,,-''             ''-,,MMMMMMMMML
              MMMMM                          MMMMMMMMML
             MMMMM                            MMMMMMMMML
            MMMMM                             MMMMMMMMMM
            MMMM                               MMMMMMMMMM
           MMMMM                               MMMMMMMMMML
          MMMMM                                MMMMMMMMMMM
         MMMMMM                                MMMMMMMMMMM
         MMMMMMM                               MMMMMMMMMMM
           ""MMMM                             MMMMMMMMMMP
        "     ""MMM                            MMMMMMMMP
   "" "         "MMMMMM                      ""MMMMMP""
 "               "MMMMMMM                   ""        ""   "
 "                ""MMMMMM                 M"             " ""
  "                 "                   MMM"                  "
 "                   "M               MMMM"                   "
 "                    "MM        MMMMMMMMM"                ""
 "                    "MMMMMMMMMMMMMMMMMMM                
                      MMMMMMMMMMMMMMMMMM"           ""
                   ""       MMMMM               "        ""
                     ""                      "  Larry Ewing & r^2