diff --git a/Adder/src/adder/Main.java b/Adder/src/adder/Main.java index 6fe76933..f04c8361 100644 --- a/Adder/src/adder/Main.java +++ b/Adder/src/adder/Main.java @@ -1,17 +1,26 @@ -package adder; +File: Main.java -public class Main { - - public static void main(String[] args) { - try { - int result = addArguments(args); - System.out.println(result); - } catch (Exception e) { - System.err.println("Please provide two integers to add"); +public class Main +{ + public static void main(String args[]) + { + try + { + int result = addArguments(args); + System.out.println(result); + } + catch(Exception e) + { + System.err.println("Please provide integers to add "); + } + } + private static int addArguments(String[] args) + { + int sum = 0 ; // variable to store sum + for(int i=0; i < args.length; i++)// Loop to add all array element + { + sum = sum + Integer.valueOf(args[i]); // compute sum + } + return sum; //return sum } - } - - private static int addArguments(String[] args) { - return Integer.valueOf(args[0]) + Integer.valueOf(args[1]); - } } diff --git a/DELETEME.txt b/DELETEME.txt deleted file mode 100644 index 78695feb..00000000 --- a/DELETEME.txt +++ /dev/null @@ -1 +0,0 @@ -Make sure you delete this file. diff --git a/README.md b/README.md index 834291b3..cb5455b0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +Name:Jonathan German +NetID: JXG190036@utdallas.edu # Assignment 1 Example repository In this assignment you will perform a series of basic Git actions to get you familiarized with the basics. diff --git a/answers.tx b/answers.tx new file mode 100644 index 00000000..aa39600a --- /dev/null +++ b/answers.tx @@ -0,0 +1,18 @@ +(a) How many commits exist in the repository history after completing step 8 (Including commits made by the original author)? +12 commits exist in the repository history after completing step 8. + +(b) When was the file .gitignore added? +.gitignore file was added four years ago. + +(c) What is the difference between git log and git status? +Git log shows the repository history while git status shows the current working directory and the staging area. + +(d) What is the difference between unstaged and untracked files? +Untracked files are not on git while unstaged files are on git but are not marked for commit. + +(e) What is the difference between git checkout and git reset? +Git Resset is specifically used for upadating the index while git checkout is for updating the working tree directly. + +(f) What happens if you try to pull remote changes when there are uncommitted changes in your working directory? +Git will give the following error message so you do not loose any vital code : "Cannot checkout as your working directory has uncommitted changes " +TEST diff --git a/status.txt b/status.txt new file mode 100644 index 00000000..f2d10429 --- /dev/null +++ b/status.txt @@ -0,0 +1,13 @@ +jgerm@DESKTOP-S869PSA MINGW64 /c/Users/jgerm/Desktop/Project File 3354/project file 3354/3354-git (master) +$ git status +On branch master +Your branch is up to date with 'origin/master'. + +Changes to be committed: + (use "git restore --staged ..." to unstage) + new file: README - Copy.md + +Changes not staged for commit: + (use "git add/rm ..." to update what will be committed) + (use "git restore ..." to discard changes in working directory) + deleted: README - Copy.md