Lab 0 (Year 3 Sem 1)

Lab 0 is the first lab in semester 1 of year 3, and the first lab in the total of year 3. It is a lab for setting up Java, and is considered to be effortless.

Description
Please follow the instructions stated in this lab to install and setup all required software for this module.

Unlocked after completion

 * OCD (Score at least 60% for Lab 0: Setting up Java)
 * All Ready (Score at least 100% for Lab 0: Setting up Java)

Question
Java syntax is defined in the Java language specification, and the Java library is defined in the Java API. The JDK is the software for developing and running Java programs. An IDE is an integrated development environment for rapidly developing programs.

Computer languages have strict rules of usage. If you do not follow the rules when writing a program, the computer will not be able to understand it. The Java language specification and the Java API define the Java standards.

The Java language specification is a technical definition of the Java programming language’s syntax and semantics. You can find the complete Java language specification at http://docs.oracle.com/javase/specs/.

The application program interface (API), also known as library, contains predefined classes and interfaces for developing Java programs. The API is still expanding. You can view the latest version of the Java API at https://docs.oracle.com/en/java/javase/17/docs/api/index.html.

Java is a full-fledged and powerful language that can be used in many ways. It comes in three editions:
 * Java Standard Edition (Java SE) to develop client-side applications. The applications can run standalone or as applets running from a Web browser.
 * Java Enterprise Edition (Java EE) to develop server-side applications, such as Java servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).
 * Java Micro Edition (Java ME) to develop applications for mobile devices, such as cell phones.

This course uses Java SE to introduce Java programming. Java SE is the foundation upon which all other Java technology is based. There are many versions of Java SE. The latest, Java SE 17, is used in this module. Oracle releases each version with a Java Development Toolkit (JDK). For Java SE 17, the Java Development Toolkit is called JDK 17 (also known as Java 17).

The JDK consists of a set of separate programs, each invoked from a command line, for developing and testing Java programs. Instead of using the JDK, you can use a Java development tool (e.g., NetBeans, Eclipse, IntelliJ and TextPad)—software that provides an integrated development environment (IDE) for developing Java programs quickly. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface. You simply enter source code in one window or open an existing file in a window, and then click a button or menu item or press a function key to compile and run the program. In this course, we will use IntelliJ as the main IDE for Java programming.

Solution
Just select the option "Mark as Completed Reading", for all questions in this lab.

Question
For non-PLD computers NOT fitted with the DMA:

Download & Install JDK 17 from the following website: https://www.oracle.com/java/technologies/javase-jdk17-downloads.html

For PLDs fitted with the DMA:

Note that if you are using your PLD, you can only access the installer in the "Company Portal" program in your computer.

Install Java 17 SDK into your PLD.

Solution
Seriously, just select the option "Mark as Completed Reading". Why are you even reading this.

Question
For non-PLD computers NOT fitted with the DMA:

Download & install IntelliJ Community Edition from the following website:

https://www.jetbrains.com/idea/download

For PLDs fitted with the DMA:

Note that if you are using your PLD, you can only access the installer in the "Company Portal" program in your computer.

Install IntelliJ IDEA into your PLD.



For the installation:

Choose the following options during installation ( for all other windows, just go with the defaults and click Next > ):



Reboot your PC after installation.

Solution
Mark as completed.

Question
Startup IntelliJ.

Do not import settings.

You will see the welcome screen as below:



Solution
-- .- .-. -.- / .- ... / -.-. --- -- .--. .-.. . - . -.. .-.-.-

Question
1. Create a new Project.

2. Choose Java and Project SDK 17 (JDK 17) - Note that you should be selecting the latest version from the Project SDK dropdown list.



3. Click Next, Next.

4. Give your project a title (make a note on where your project files are stored).



5. Click Finish.

6. Right click on src folder of your project. Select New > Java Class



7. Give the class a name (e.g. Hello). You will see a .java file create as follows:



8. Add the following code into your Hello.java



9. Click on Build > Build Project to compile the code.



10. Click Run > Run "Hello" to run the program. You should see the "Hello World." printed in the console.



Congratulations! You have successfully created, compiled and run your first Hello World program in Java.

Solution
01001101 01100001 01110010 01101011 00100000 01100001 01110011 00100000 01100011 01101111 01101101 01110000 01101100 01100101 01110100 01100101 01100100 00101110

Question
You are required to create a simple Java Program with the following message:

XXX should be replaced with your name. Enter your mentor group.

When completed, compile your code. For this question, submit a screen capture of your program, with the console output captured to show the correct message.

Note that in your screen capture, you are required to show your full source code.

You are also required to capture the Project window (expand the External Libraries like the screen cap below) to show that you manage to compile and run with JDK 17.

For example, upload a screen capture similar to the one below (but with your name and mentor group and the source code should be shown).



Solution
Printing stuff should be in the notes (notes are in Lab 1). Upload the screenshot of the code, then peko lh ocohlokep.