You are on page 1of 26

Lab 1

Concepts of programming languages


Agenda
1. Programming language generation.
2. Programming language domains.
3. Programming language categories.
4. Programming languages implementation.
5. Environment Installation.
6. Code Examples.
Contacts

TA Email
Aya Saad aya.saad@cis.asu.edu.eg
Dalia El-Alfy dalia_elalfy@cis.asu.edu.eg
Samar Aly samar.aly@cis.asu.edu.eg
Mohamed Mostafa moahmed_mosa@cis.asu.edu.eg

If you need any help, don’t hesitate to contact us, we would love to help you ☺
Programming languages
generation
Programming languages
domains
Programming languages
categories
Programming languages
implementation
Languages
Evaluation Criteria
Our course used
languages
1. Java
• Third generation, Business application, Imperative language, Hybrid implementation.
2. Scala
• Fourth generation , Business application, Functional language, Compilation.
3. Java Script
• Third generation, Web application, Imperative language, Pure Interpretation.
Installation
Java
1. Java Development Kit (JDK)
• JDK 11
• Suggested Source:
https://www.filehorse.com/download-java-development-kit-64/36775/change-l
og/

2. Integrated Development Environment (IDE)


• IntelliJ (Community Edition)
• Suggested Source:
https://www.jetbrains.com/idea/download/#section=windows
Installing JDK (Steps)
1. Download Java JDK 11 (64-bit).
2. Double-click the JDK installer
"jdk-11_windows-x64_bin.exe" file.
The installer’s Welcome screen will
appear.
3. Click "Next" to continue.
4. Click "Close" when the installation is
complete.
Installing IntelliJ IDE
(steps)

1. Download IntelliJ IDEA installer


(Community Edition)
2. Double-click the installer
"ideaIC-2021.3.2.exe" file. The
installer’s Welcome screen will appear.
3. Click "Next" to continue.
4. Click “Install" to start the installation.
5. You’ll see a progress bar for a while,
followed by a screen indicating
installation is completed.
Scala
• Download the Scala inside the IntelliJ:
1. Scala plugin.
2. Scala SDK. (showed in the code example)
Scala plugin (Steps)
1. Open IntelliJ IDEA.
2. Choose Plugins from the left menu.
3. Search for Scala and press install.
4. When the installation is finish, the
state will be “installed”.
Java Script
1. Node JS
• Suggested Source: https://nodejs.org/en/download/

2. Integrated Development Environment (IDE)


• Visual Studio Code
• Suggested Source: https://code.visualstudio.com/nodejs
Node JS
1. Download NodeJS.
2. Double-click the JDK installer
"node-v16.14.0-x64.msi" file. The
installer’s Welcome screen will
appear.
3. Click "Next" to continue.
4. Click “Install" to start the
installation.
5. Click “Finish" when the installation
is complete.
Visual Studio Code
(steps)

1. Download Visual Studio Code.


2. Double-click the JDK installer
"VSCodeUserSetup-x64-1.64.2.exe"
file. The installer’s Welcome screen
will appear.
3. Click "Next" to continue.
4. Click “Install" to start the
installation.
5. Click “Finish" when the installation
is complete.
Code Examples
Simple Scala Class
(steps)

1. Create new project.


2. Choose Scala from the left menu, and
IDEA from the right menu.
3. Press create then download to download
the Scala SDK.
4. Choose ok then finish.
5. Right click on the src, New, Scala class.
6. Name the class and choose Object as its
type.
7. Extend the class from “App” and print any
message.
Notes
1. Why the class is of type “object” ?
The main method must be a static method. In Scala to create a static method you put it in an
object.

2. Why is the Starter object extended from “App”?


The App trait is used to quickly turn objects into executable programs.
No explicit main method is needed. Instead, the whole class body becomes the “main
method”.

3. “Starter” is standalone singleton object.


Simple Java Class
(steps)

1. Create new project.


2. Choose Java from the left menu and 11
from the right side.
3. Click "Next" to continue.
4. Name the project and click finish.
5. Right click on the src, New, Java class.
6. Name the class and choose class as its
type.
7. Create a function and print a simple
message on it.
Notes
1. The name of the java file should be the same as the name of the class.
2. Can’t write any statements (ex: println), in the body of the class without being
inside of function.
Create JavaScript file
(steps)

1. Create new folder.


2. Open the VS code.
3. Drag the folder and drop it into the VS
code.
4. Create new file inside the folder.
5. Name the file “---.js”.
6. Write simple print message.
7. Run without debugging, choose node JS.
8. Check the output in the Debug Console.
Notes
1. How to run JavaScript ?
1- Terminal 2- Node JS
2. Node JS (JavaScript runtime environment) let us run the JavaScript code outside
the browser.
3. “//” is used to comment a line.
Thank you.

You might also like