From f2222d2729eacdbe00166df7b9081c962f827a7b Mon Sep 17 00:00:00 2001 From: fmi Date: Sun, 23 Nov 2014 14:13:56 +0200 Subject: [PATCH 01/14] first commit --- .../JavaApplication21/build.xml | 73 + .../JavaApplication21/manifest.mf | 3 + .../nbproject/build-impl.xml | 1413 +++++++++++++++++ .../nbproject/genfiles.properties | 8 + .../nbproject/project.properties | 73 + .../JavaApplication21/nbproject/project.xml | 15 + .../javaapplication21/JavaApplication21.java | 32 + 7 files changed, 1617 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaApplication21/build.xml create mode 100644 1401437005_NinaGenovska/JavaApplication21/manifest.mf create mode 100644 1401437005_NinaGenovska/JavaApplication21/nbproject/build-impl.xml create mode 100644 1401437005_NinaGenovska/JavaApplication21/nbproject/genfiles.properties create mode 100644 1401437005_NinaGenovska/JavaApplication21/nbproject/project.properties create mode 100644 1401437005_NinaGenovska/JavaApplication21/nbproject/project.xml create mode 100644 1401437005_NinaGenovska/JavaApplication21/src/javaapplication21/JavaApplication21.java diff --git a/1401437005_NinaGenovska/JavaApplication21/build.xml b/1401437005_NinaGenovska/JavaApplication21/build.xml new file mode 100644 index 0000000..6e42e38 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project JavaApplication21. + + + diff --git a/1401437005_NinaGenovska/JavaApplication21/manifest.mf b/1401437005_NinaGenovska/JavaApplication21/manifest.mf new file mode 100644 index 0000000..1574df4 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/1401437005_NinaGenovska/JavaApplication21/nbproject/build-impl.xml b/1401437005_NinaGenovska/JavaApplication21/nbproject/build-impl.xml new file mode 100644 index 0000000..19c81a6 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/nbproject/build-impl.xml @@ -0,0 +1,1413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/1401437005_NinaGenovska/JavaApplication21/nbproject/genfiles.properties b/1401437005_NinaGenovska/JavaApplication21/nbproject/genfiles.properties new file mode 100644 index 0000000..8ab4c50 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=50ac9e9f +build.xml.script.CRC32=8b8f26a8 +build.xml.stylesheet.CRC32=8064a381@1.74.2.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=50ac9e9f +nbproject/build-impl.xml.script.CRC32=072d0176 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/1401437005_NinaGenovska/JavaApplication21/nbproject/project.properties b/1401437005_NinaGenovska/JavaApplication21/nbproject/project.properties new file mode 100644 index 0000000..d5c3f0f --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/nbproject/project.properties @@ -0,0 +1,73 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/JavaApplication21.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=javaapplication21.JavaApplication21 +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/1401437005_NinaGenovska/JavaApplication21/nbproject/project.xml b/1401437005_NinaGenovska/JavaApplication21/nbproject/project.xml new file mode 100644 index 0000000..cc6b916 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + JavaApplication21 + + + + + + + + + diff --git a/1401437005_NinaGenovska/JavaApplication21/src/javaapplication21/JavaApplication21.java b/1401437005_NinaGenovska/JavaApplication21/src/javaapplication21/JavaApplication21.java new file mode 100644 index 0000000..743ecc3 --- /dev/null +++ b/1401437005_NinaGenovska/JavaApplication21/src/javaapplication21/JavaApplication21.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package javaapplication21; + +/** + * + * @author fmi + */ +public class JavaApplication21 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + String name [] = {"Ivelin", "Ivan", "Nina", "Violin", "Ivon"}; + nameFinishesWith(name,"in"); + } + + private static void nameFinishesWith(String name [] , String search) { + System.out.println("nameFinishesWith" + search + ":"); + for(int i=0; i Date: Sat, 29 Nov 2014 17:06:15 +0200 Subject: [PATCH 02/14] --- .../javaapplication1/JavaApplication1.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise1_2/src/javaapplication1/JavaApplication1.java diff --git a/1401437005_NinaGenovska/JavaExercise1_2/src/javaapplication1/JavaApplication1.java b/1401437005_NinaGenovska/JavaExercise1_2/src/javaapplication1/JavaApplication1.java new file mode 100644 index 0000000..d6a30f0 --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise1_2/src/javaapplication1/JavaApplication1.java @@ -0,0 +1,28 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaapplication1; + +/** + * + * @author Nina + */ +public class JavaApplication1 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + int i; + i=5; + i+=10; + System.out.println(i); + + + + } + +} From 2665f7cd9acbf4b24d02b81b1098c1059bcf839f Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 29 Nov 2014 17:13:58 +0200 Subject: [PATCH 03/14] --- .../javaapplication2/JavaApplication2.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise1_3/src/javaapplication2/JavaApplication2.java diff --git a/1401437005_NinaGenovska/JavaExercise1_3/src/javaapplication2/JavaApplication2.java b/1401437005_NinaGenovska/JavaExercise1_3/src/javaapplication2/JavaApplication2.java new file mode 100644 index 0000000..77eb9d2 --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise1_3/src/javaapplication2/JavaApplication2.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaapplication2; + +/** + * + * @author Nina + */ +public class JavaApplication2 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + double x=2,y=5; + System.out.println(x + " + " + y + " = " + (x+y)); + System.out.println(x + " - " + y + " = " + (x-y)); + System.out.println(x + " * " + y + " = " + (x*y)); + System.out.println(x + " / " + y + " = " + (x/y)); + + } + +} From 7928c007fbdc4ddef5d3f55f5e83760700d50703 Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 29 Nov 2014 17:18:57 +0200 Subject: [PATCH 04/14] --- .../src/javaapplication16/Exercise 2_15.txt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise2_15/src/javaapplication16/Exercise 2_15.txt diff --git a/1401437005_NinaGenovska/JavaExercise2_15/src/javaapplication16/Exercise 2_15.txt b/1401437005_NinaGenovska/JavaExercise2_15/src/javaapplication16/Exercise 2_15.txt new file mode 100644 index 0000000..8c0e165 --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise2_15/src/javaapplication16/Exercise 2_15.txt @@ -0,0 +1,40 @@ +package javaapplication16; + +/** + * + * @author Nina + */ +public class JavaApplication16 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + int c = 1; + for (int i = 1; i <= 5; i++) + { + for (int j = i; j < 5; j++) + { + System.out.print(" "); + } + for (int k = 1; k <= c; k++) + { + if (k % 2 == 0) + System.out.print(" "); + else + System.out.print("A"); + } + System.out.println(); + c += 2; + + } + } +} + +run: + A + A A + A A A + A A A A +A A A A A +BUILD SUCCESSFUL (total time: 0 seconds) \ No newline at end of file From c97c261d14dafc95f18b7f50c64ae45e46078d38 Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 29 Nov 2014 18:05:51 +0200 Subject: [PATCH 05/14] --- ...\265\320\275\320\264\320\260\321\200.java" | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 "1401437005_NinaGenovska/JavaExercise2_9/src/javaapplication19/\320\232\320\260\320\273\320\265\320\275\320\264\320\260\321\200.java" diff --git "a/1401437005_NinaGenovska/JavaExercise2_9/src/javaapplication19/\320\232\320\260\320\273\320\265\320\275\320\264\320\260\321\200.java" "b/1401437005_NinaGenovska/JavaExercise2_9/src/javaapplication19/\320\232\320\260\320\273\320\265\320\275\320\264\320\260\321\200.java" new file mode 100644 index 0000000..617c524 --- /dev/null +++ "b/1401437005_NinaGenovska/JavaExercise2_9/src/javaapplication19/\320\232\320\260\320\273\320\265\320\275\320\264\320\260\321\200.java" @@ -0,0 +1,59 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaapplication19; + +import java.util.Scanner; + +/** + * + * @author Nina + */ +public class Календар{ + + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + System.out.println("Въведете число от 1 до 12"); + Scanner s = new Scanner(System.in); + int месец = s.nextInt(); + String текст; + switch(месец){ + case 1: текст = "Януари"; + break; + case 2: текст = "Февруари"; + break; + case 3: текст = "Март";; + break; + case 4: текст = "Април"; + break; + case 5: текст = "Май"; + break; + case 6: текст = "Юни"; + break; + case 7: текст = "Юли"; + break; + case 8: текст = "Август"; + break; + case 9: текст = "Септември"; + break; + case 10: текст = "Октомври"; + break; + case 11: текст = "Ноември"; + break; + case 12: текст = "Декември"; + break; + default: текст = "Грешен месец"; + + } + System.out.println(текст); + s.close(); + + + } + +} From c4b78fdead57ca504fa86f389d19facfc8ce194b Mon Sep 17 00:00:00 2001 From: Nina Date: Wed, 3 Dec 2014 20:25:22 +0200 Subject: [PATCH 06/14] --- .../src/values/fibonacci/ValuesFibonacci.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 1401437005_NinaGenovska/Values Fibonacci/src/values/fibonacci/ValuesFibonacci.java diff --git a/1401437005_NinaGenovska/Values Fibonacci/src/values/fibonacci/ValuesFibonacci.java b/1401437005_NinaGenovska/Values Fibonacci/src/values/fibonacci/ValuesFibonacci.java new file mode 100644 index 0000000..e077511 --- /dev/null +++ b/1401437005_NinaGenovska/Values Fibonacci/src/values/fibonacci/ValuesFibonacci.java @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package values.fibonacci; + + + +import java.util.Scanner; + +/** + * + * @author Nina + */ +public class ValuesFibonacci { + + public static void main(String[] args) { + // TODO code application logic here + System.out.print("Enter number upto which Fibonacci series to print: "); + int number = new Scanner(System.in).nextInt(); + System.out.println("\n\nFibonacci series upto " + number +" numbers : "); + for(int i=1; i<=number; i++){ + System.out.print(fibonacciRecusion(i) +" "); + } + } + public static int fibonacciRecusion(int number){ + if(number == 1 || number == 2){ + return 1; + } + + return fibonacciRecusion(number-1) + fibonacciRecusion(number -2); + } +} + + + From d3adb3618dfd6a4190adaeb67d502394a6320ead Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 6 Dec 2014 18:43:16 +0200 Subject: [PATCH 07/14] --- .../javaapplication18/JavaApplication18.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise3_6/src/javaapplication18/JavaApplication18.java diff --git a/1401437005_NinaGenovska/JavaExercise3_6/src/javaapplication18/JavaApplication18.java b/1401437005_NinaGenovska/JavaExercise3_6/src/javaapplication18/JavaApplication18.java new file mode 100644 index 0000000..4a4ea09 --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise3_6/src/javaapplication18/JavaApplication18.java @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaapplication18; + + + +/** + * + * @author Nina + */ +public class JavaApplication18 { + +public static void m(int x, int y){ + do{ + System.out.println(x); + x++; + }while(x<=y); + + } + + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + + m(5,9); + + + } + +} From 735a81933cf1937223e1839792d937da78367d17 Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 6 Dec 2014 18:50:51 +0200 Subject: [PATCH 08/14] --- .../src/javaexercise2_5/JavaExercise2_5.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise2_5/src/javaexercise2_5/JavaExercise2_5.java diff --git a/1401437005_NinaGenovska/JavaExercise2_5/src/javaexercise2_5/JavaExercise2_5.java b/1401437005_NinaGenovska/JavaExercise2_5/src/javaexercise2_5/JavaExercise2_5.java new file mode 100644 index 0000000..e1618cd --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise2_5/src/javaexercise2_5/JavaExercise2_5.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise2_5; + +import java.util.Scanner; + +/** + * + * @author Nina + */ +public class JavaExercise2_5 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + Scanner scanner = new Scanner(System.in); + System.out.println("Въведете x ="); + int x = scanner.nextInt(); + System.out.println("Въведете y ="); + int y = scanner.nextInt(); + System.out.println("Въведете z ="); + int z = scanner.nextInt(); + int d = x >y? x: y; + System.out.println("Максималното число е " + Math.max(d, z)); + } + +} From 55625afc17e477ef24cc14b4ba99b2bd2bab5f61 Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 6 Dec 2014 18:54:49 +0200 Subject: [PATCH 09/14] --- .../javaexercise2_10/JavaExercise2_10.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise2_10/src/javaexercise2_10/JavaExercise2_10.java diff --git a/1401437005_NinaGenovska/JavaExercise2_10/src/javaexercise2_10/JavaExercise2_10.java b/1401437005_NinaGenovska/JavaExercise2_10/src/javaexercise2_10/JavaExercise2_10.java new file mode 100644 index 0000000..11fca0d --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise2_10/src/javaexercise2_10/JavaExercise2_10.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise2_10; + +/** + * + * @author Nina + */ +public class JavaExercise2_10 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + double [] massiv = new double[5]; + massiv[0] = 1.1; + massiv [1] = 1.2; + massiv[2] = 1.3; + massiv[3] = 1.4; + massiv[4] = 1.5; + for(int i=0; i Date: Sat, 6 Dec 2014 19:03:47 +0200 Subject: [PATCH 10/14] --- .../javaexercise2_11/JavaExercise2_11.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise2_11/src/javaexercise2_11/JavaExercise2_11.java diff --git a/1401437005_NinaGenovska/JavaExercise2_11/src/javaexercise2_11/JavaExercise2_11.java b/1401437005_NinaGenovska/JavaExercise2_11/src/javaexercise2_11/JavaExercise2_11.java new file mode 100644 index 0000000..98b4cfc --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise2_11/src/javaexercise2_11/JavaExercise2_11.java @@ -0,0 +1,43 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise2_11; + +import java.util.Scanner; + +/** + * + * @author Nina + */ +public class JavaExercise2_11 { +public static void m(int[]massiv){ + for(int i=0; i< massiv.length; i++) + System.out.println(massiv[i]); +} +public static void m1(int[]massiv){ + for(int i= massiv.length - 1; i<0; i--) + System.out.println(massiv[i]); + +} + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + Scanner imput = new Scanner(System.in); + System.out.println("Enter the lenght of array"); + int lenght = imput.nextInt(); + int[] myArray = new int[lenght]; + for (int i = 0; i < myArray.length; i++){ + System.out.println("Please enter element myArray[\" + i + \"]\""); + myArray[i] = imput.nextInt(); + } + m(myArray); + m1(myArray); + System.out.println(); + + } + +} From b0c5da5f90deb8bb0bcb3aac88f83862fc06ad41 Mon Sep 17 00:00:00 2001 From: Nina Date: Sat, 6 Dec 2014 20:25:47 +0200 Subject: [PATCH 11/14] --- .../src/javacalculator/jCalculator.java | 519 ++++++++++++++++++ 1 file changed, 519 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaCalculator/src/javacalculator/jCalculator.java diff --git a/1401437005_NinaGenovska/JavaCalculator/src/javacalculator/jCalculator.java b/1401437005_NinaGenovska/JavaCalculator/src/javacalculator/jCalculator.java new file mode 100644 index 0000000..5829f90 --- /dev/null +++ b/1401437005_NinaGenovska/JavaCalculator/src/javacalculator/jCalculator.java @@ -0,0 +1,519 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javacalculator; + +/** + * + * @author Nina + */ +public class jCalculator extends javax.swing.JFrame { + private double total1 = 0; + private double total2 =0; + private char mathOperator; + + + + + /** + * Creates new form jCalculator + */ + public jCalculator() { + initComponents(); + + } + private void getOperator(String btnText){ + mathOperator = btnText.charAt(0); + total1 = total1 + Double.parseDouble(txtDisplay.getText()); + txtDisplay.setText(""); + + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + + // + private void initComponents() { + + txtDisplay = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + btnOne = new javax.swing.JButton(); + btnTwo = new javax.swing.JButton(); + btnThree = new javax.swing.JButton(); + btnFour = new javax.swing.JButton(); + btnFive = new javax.swing.JButton(); + btnSix = new javax.swing.JButton(); + btnSeven = new javax.swing.JButton(); + btnEight = new javax.swing.JButton(); + btnNine = new javax.swing.JButton(); + btnZero = new javax.swing.JButton(); + btnClear = new javax.swing.JButton(); + btnPoint = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + btnAdd = new javax.swing.JButton(); + btnSub = new javax.swing.JButton(); + btnDiv = new javax.swing.JButton(); + btnMul = new javax.swing.JButton(); + btnEqually = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + txtDisplay.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtDisplayActionPerformed(evt); + } + }); + + btnOne.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnOne.setText("1"); + btnOne.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnOneActionPerformed(evt); + } + }); + + btnTwo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnTwo.setText("2"); + btnTwo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnTwoActionPerformed(evt); + } + }); + + btnThree.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnThree.setText("3"); + btnThree.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnThreeActionPerformed(evt); + } + }); + + btnFour.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnFour.setText("4"); + btnFour.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFourActionPerformed(evt); + } + }); + + btnFive.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnFive.setText("5"); + btnFive.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFiveActionPerformed(evt); + } + }); + + btnSix.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSix.setText("6"); + btnSix.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSixActionPerformed(evt); + } + }); + + btnSeven.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSeven.setText("7"); + btnSeven.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSevenActionPerformed(evt); + } + }); + + btnEight.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnEight.setText("8"); + btnEight.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnEightActionPerformed(evt); + } + }); + + btnNine.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNine.setText("9"); + btnNine.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNineActionPerformed(evt); + } + }); + + btnZero.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnZero.setText("0"); + btnZero.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnZeroActionPerformed(evt); + } + }); + + btnClear.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnClear.setText("C"); + btnClear.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnClearActionPerformed(evt); + } + }); + + btnPoint.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnPoint.setText("."); + btnPoint.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPointActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnSeven) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnEight)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnFour) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnFive))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnSix) + .addComponent(btnNine))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnZero) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnPoint) + .addGap(11, 11, 11) + .addComponent(btnClear)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnOne) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnTwo) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnThree, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addGap(105, 105, 105)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSeven) + .addComponent(btnEight) + .addComponent(btnNine)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnFive) + .addComponent(btnFour) + .addComponent(btnSix)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnOne) + .addComponent(btnTwo) + .addComponent(btnThree)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnZero) + .addComponent(btnPoint) + .addComponent(btnClear)) + .addGap(45, 45, 45)) + ); + + btnAdd.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnAdd.setText("+"); + btnAdd.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddActionPerformed(evt); + } + }); + + btnSub.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSub.setText("-"); + btnSub.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSubActionPerformed(evt); + } + }); + + btnDiv.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnDiv.setText("/"); + btnDiv.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnDivActionPerformed(evt); + } + }); + + btnMul.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnMul.setText("*"); + btnMul.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnMulActionPerformed(evt); + } + }); + + btnEqually.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnEqually.setText("="); + btnEqually.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnEquallyActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(btnAdd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSub, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnDiv, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE) + .addComponent(btnMul, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnEqually, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(27, 27, 27)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAdd) + .addComponent(btnDiv)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSub) + .addComponent(btnMul)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnEqually)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(50, 50, 50) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(32, 32, 32) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(119, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(36, 36, 36) + .addComponent(txtDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(40, 40, 40) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// + + private void txtDisplayActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + } + + private void btnOneActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "1"; + txtDisplay.setText(display); + + } + + private void btnTwoActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "2"; + txtDisplay.setText(display); + } + + private void btnThreeActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String dispay = txtDisplay.getText() + "3"; + txtDisplay.setText(dispay); + } + + private void btnZeroActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "0"; + txtDisplay.setText(display); + } + + private void btnFourActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "4"; + txtDisplay.setText(display); + } + + private void btnFiveActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "5"; + txtDisplay.setText(display); + } + + private void btnSixActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "6"; + txtDisplay.setText(display); + } + + private void btnSevenActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "7"; + txtDisplay.setText(display); + } + + private void btnEightActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "8"; + txtDisplay.setText(display); + } + + private void btnNineActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "9"; + txtDisplay.setText(display); + } + + private void btnPointActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String display = txtDisplay.getText() + "."; + txtDisplay.setText(display); + + + } + + private void btnAddActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String button_text = btnAdd.getText(); + getOperator(button_text); + total1 = total1 + Double.parseDouble(txtDisplay.getText()); + txtDisplay.setText(""); + + + } + + private void btnEquallyActionPerformed(java.awt.event.ActionEvent evt) { + + // TODO add your handling code here: + switch (mathOperator){ + case '+':total2 = total1 + Double.parseDouble(txtDisplay.getText( ) ); + break; + case'-':total2 = total1 - Double.parseDouble(txtDisplay.getText( ) ); + break; + case'/':total2 = total1 / Double.parseDouble(txtDisplay.getText( ) ); + break; + case'*':total2 = total1 * Double.parseDouble(txtDisplay.getText( ) ); + break; + + } + txtDisplay.setText( Double.toString( total2) ); + total1 = 0; + + } + + private void btnClearActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + total2 = 0; + txtDisplay.setText(""); + } + + private void btnSubActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String button_text = btnSub.getText(); + getOperator(button_text); + } + + private void btnDivActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String button_text = btnDiv.getText(); + getOperator(button_text); + } + + private void btnMulActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + String button_text = btnMul.getText(); + getOperator(button_text); + } + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(jCalculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(jCalculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(jCalculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(jCalculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new jCalculator().setVisible(true); + } + }); + } + + // Variables declaration - do not modify + private javax.swing.JButton btnAdd; + private javax.swing.JButton btnClear; + private javax.swing.JButton btnDiv; + private javax.swing.JButton btnEight; + private javax.swing.JButton btnEqually; + private javax.swing.JButton btnFive; + private javax.swing.JButton btnFour; + private javax.swing.JButton btnMul; + private javax.swing.JButton btnNine; + private javax.swing.JButton btnOne; + private javax.swing.JButton btnPoint; + private javax.swing.JButton btnSeven; + private javax.swing.JButton btnSix; + private javax.swing.JButton btnSub; + private javax.swing.JButton btnThree; + private javax.swing.JButton btnTwo; + private javax.swing.JButton btnZero; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JTextField txtDisplay; + // End of variables declaration + + + +} From 4ff204f017ece3da3eeb85b770cff1551b59d658 Mon Sep 17 00:00:00 2001 From: Nina Date: Fri, 12 Dec 2014 20:20:02 +0200 Subject: [PATCH 12/14] --- .../src/javaexercise5/JavaExercise5.java | 35 +++++++++++++ .../src/javaexercise5/Person.java | 49 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/JavaExercise5.java create mode 100644 1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/Person.java diff --git a/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/JavaExercise5.java b/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/JavaExercise5.java new file mode 100644 index 0000000..dfcf789 --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/JavaExercise5.java @@ -0,0 +1,35 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise5; + +/** + * + * @author Nina + */ +public class JavaExercise5 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + Person nina; + nina = new Person (" Nina", " Genovska", 32); + //nina.name = " Nina "; + //nina.surname = " Genovska "; + //nina.age = 32; + //System.out.println(" I am a person.My name is " + nina.name + "." + "My surname is " + nina.surname + "." + " I am " + nina.age + " years old."); + nina.IntroduceYourself(); + Person george; + george = new Person("George", "Georgiev", 20); + //george.name = " George "; + //george.surname = " Georgiev "; + //eorge.age = 20; + //System.out.println(" I am a person.My name is " + george.name + "." + "My surname is " + george.surname + "." + " I am " + george.age + " years old."); + george.IntroduceYourself(); + } + +} diff --git a/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/Person.java b/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/Person.java new file mode 100644 index 0000000..e1aa87c --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise5/src/javaexercise5/Person.java @@ -0,0 +1,49 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise5; + +/** + * + * @author Nina + */ +public class Person { + public String name; + public String surname; + public int age; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + public Person (String name, String surname, int age) { + this.name = name; + this.surname = surname; + this.age = age; + } + public void IntroduceYourself(){ + System.out.println(" Hello world!I am a person.My name is " + name + "." + "My surname is " + surname + "." + " I am " + age + " years old."); + + } +} From c237211b80f1fc347f44624794d0cfbc340a7ecb Mon Sep 17 00:00:00 2001 From: Nina Date: Tue, 16 Dec 2014 13:46:43 +0200 Subject: [PATCH 13/14] --- .../javaexercise3_10/JavaExercise3_10.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 1401437005_NinaGenovska/JavaExercise3_10/src/javaexercise3_10/JavaExercise3_10.java diff --git a/1401437005_NinaGenovska/JavaExercise3_10/src/javaexercise3_10/JavaExercise3_10.java b/1401437005_NinaGenovska/JavaExercise3_10/src/javaexercise3_10/JavaExercise3_10.java new file mode 100644 index 0000000..fbec6cb --- /dev/null +++ b/1401437005_NinaGenovska/JavaExercise3_10/src/javaexercise3_10/JavaExercise3_10.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package javaexercise3_10; +import java.util.Scanner; +/** + * + * @author Nina + */ +public class JavaExercise3_10 { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + Scanner scanner = new Scanner(System.in); + System.out.println(" Enter an integer: "); + int number = scanner.nextInt(); + System.out.println(" Bits : " + Integer.toBinaryString(number)); + } + +} From 9ddcf55c73153a7dac2949c4e8ba205132dcd5c6 Mon Sep 17 00:00:00 2001 From: Nina Date: Thu, 18 Dec 2014 16:15:25 +0200 Subject: [PATCH 14/14] --- .../CourseProject_Exercise_1_b.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 1401437005_NinaGenovska/CourseProject_Exercise_1_b/src/courseproject_exercise_1_b/CourseProject_Exercise_1_b.java diff --git a/1401437005_NinaGenovska/CourseProject_Exercise_1_b/src/courseproject_exercise_1_b/CourseProject_Exercise_1_b.java b/1401437005_NinaGenovska/CourseProject_Exercise_1_b/src/courseproject_exercise_1_b/CourseProject_Exercise_1_b.java new file mode 100644 index 0000000..3a8b26b --- /dev/null +++ b/1401437005_NinaGenovska/CourseProject_Exercise_1_b/src/courseproject_exercise_1_b/CourseProject_Exercise_1_b.java @@ -0,0 +1,41 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package courseproject_exercise_1_b; + +import java.util.Random; + +/** + * + * @author Nina + */ +public class CourseProject_Exercise_1_b { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + int arr[] = new int[6]; + int multiplied = 1; + for(int i = 0; i < arr.length; i++){ + arr[i] = generate(); + System.out.println(arr[i]); + if(arr[i]%2 != 0 && arr[i] != 0){ + multiplied = multiplied * arr[i]; + } + } + System.out.println( " Произведението на всички нечетни числа различни от нула e: " + multiplied); + } + private static int generate(){ + Random r = new Random(); + int n = r.nextInt(201); + return n-100; + } +} + + + +