Lab 1

Introduction to Java environment and lab tools.

Objectives

  • Configure working environment
  • Creating and running first java program
  • Working with git

Documentation

Exercise 1

Join ISP piazza forum following this link. Access code will be provided in class by instructor.

email for piazzza registration

Exercise 2

NOTE: User account format will be: nume-prenume-grupa. Ex: popescu-dan-30123

  • After register github account please answer to this form;

Exercise 3

NOTE: By following and accepting assignment a git repository will be created in your github account.

Exercise 4

  • Open a command line prompt and change directory to your working folder for this lab. Example:
cd c:\UTCN\isp
  • Clone repository locally by executing following command from cmd opened in previous step:
git clone {repository-link}
  • Change directory to the one created in previous step as result of cloning locally repository
cd c:\UTCN\isp\{repository-folder}
  • Read instructions from 'readme.md' file and test commands from command line for: running tests and running program.

Exercise 5

  • Import project cloned in previous step in Intellij IDEA
  • Run main class from IntelliJ IDEA
  • Observe that subtract function has a wrong implementation. Fix the implementation, rerun tests and make sure all tests pass
  • Commit and push all changes to remote repository using commands:
git add . 
git commit -m "Fix issue with substract method."
git push

Exercise 6

  • Add a new method 'multiply' in class “Example” which will multiply 2 arguments and will return the results;
  • Add a test for the newly created method;
  • Run tests and make sure all tests pass;
  • Add all your changes and push them to remote repositoy;

Exercise 7

  • Add a new class in the existing project
package isp.lab1
public class HelloWorld {
 
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
 
}
  • Run the HelloWorld main method from Intellij IDE;
  • Add all your changes and push them to remote repositoy;