diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build.xml b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build.xml new file mode 100644 index 0000000..fe8dd3e --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project zad2v. + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/.netbeans_automatic_build b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/.netbeans_update_resources b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/.netbeans_update_resources new file mode 100644 index 0000000..e69de29 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/RandomGenerator.class b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/RandomGenerator.class new file mode 100644 index 0000000..f0765ed Binary files /dev/null and b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/RandomGenerator.class differ diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/Zad2v.class b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/Zad2v.class new file mode 100644 index 0000000..622b208 Binary files /dev/null and b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/build/classes/zad2v/Zad2v.class differ diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/manifest.mf b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/build-impl.xml b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/build-impl.xml new file mode 100644 index 0000000..9a85af2 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/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/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/genfiles.properties b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/genfiles.properties new file mode 100644 index 0000000..8d9717b --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=4845f82a +build.xml.script.CRC32=fc5372a6 +build.xml.stylesheet.CRC32=8064a381@1.75.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=4845f82a +nbproject/build-impl.xml.script.CRC32=9cb83f7c +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.properties b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.properties new file mode 100644 index 0000000..d81ce63 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Avkov\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.xml b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.xml new file mode 100644 index 0000000..3ab6ec6 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/private/private.xml @@ -0,0 +1,9 @@ + + + + + + file:/D:/Обучение/Софтуерни%20Технологии/Y1-T1/Структури%20от%20данни%20и%20ООП/EXAMS/ZAD2%20V/zad2v/src/zad2v/Zad2v.java + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/project.properties b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/project.properties new file mode 100644 index 0000000..ae81bc4 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/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}/zad2v.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=zad2v.Zad2v +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/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/project.xml b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/project.xml new file mode 100644 index 0000000..c2745bb --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + zad2v + + + + + + + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/src/zad2v/Zad2v.java b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/src/zad2v/Zad2v.java new file mode 100644 index 0000000..f3accf1 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD2 V/zad2v/src/zad2v/Zad2v.java @@ -0,0 +1,58 @@ +package zad2v; + +import java.util.Random; + +public class Zad2v { + + public static void main(String[] args) { + + int[] arr = generateArray(6); + double average = getAverage(arr); + System.out.println("average ->" + average); + } + + /* + * Generiram masiva s random generator ot -100 do 100 + */ + private static int[] generateArray(int elementsCount) { + + RandomGenerator rg = new RandomGenerator(); + int[] toReturn = new int[elementsCount]; + int counter = 0; + int element; + + while (counter < elementsCount) { + element = rg.nextInt(-100, 100); + toReturn[counter] = element; + System.out.println(counter + " => " + element); + counter++; + } + return toReturn; + } + + /* + * Tuk trqbva da napravim funkcia ili s drugi dumi metod chrez koito da izpulnbil uslovieto na zadachata no tui kato + * predstava si niamam kakvo e cheten indeks...... + */ + private static double getOddIndex(int[] arr) { + int elementsSum = 0; + int elementsCount = 0; + for (int i = 0; i < arr.length; i++) { + if (/*uslovieto kato razberem kakvo e cheten indeks go formulirame tuk :D*/) { + /*Tuka volizat operaciite*/ + } + } + + } + +} + +/* + * Ekstendvam Random + */ +class RandomGenerator extends Random { + + public int nextInt(int lower, int upper) { + return nextInt((upper - lower + 1)) + lower; + } +} diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build.xml b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build.xml new file mode 100644 index 0000000..bf880a9 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project EGN. + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/.netbeans_automatic_build b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/.netbeans_update_resources b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/.netbeans_update_resources new file mode 100644 index 0000000..e69de29 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.class b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.class new file mode 100644 index 0000000..021ad46 Binary files /dev/null and b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.class differ diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.rs b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.rs new file mode 100644 index 0000000..c402d76 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/build/classes/egn/EGN.rs @@ -0,0 +1 @@ +test.Test3 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/manifest.mf b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/build-impl.xml b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/build-impl.xml new file mode 100644 index 0000000..457c1b7 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/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/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/genfiles.properties b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/genfiles.properties new file mode 100644 index 0000000..c080be3 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0a1f6b03 +build.xml.script.CRC32=9937e6bf +build.xml.stylesheet.CRC32=8064a381@1.75.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=0a1f6b03 +nbproject/build-impl.xml.script.CRC32=8c206b0e +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.properties b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.properties new file mode 100644 index 0000000..d81ce63 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Avkov\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.xml b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.xml new file mode 100644 index 0000000..0dfc210 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/private/private.xml @@ -0,0 +1,9 @@ + + + + + + file:/D:/Обучение/Софтуерни%20Технологии/Y1-T1/Структури%20от%20данни%20и%20ООП/EXAMS/ZAD5%20EGN/EGN/src/egn/EGN.java + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/project.properties b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/project.properties new file mode 100644 index 0000000..4e3da90 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/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}/EGN.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=egn.EGN +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/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/project.xml b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/project.xml new file mode 100644 index 0000000..f192090 --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + EGN + + + + + + + + + diff --git a/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/src/egn/EGN.java b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/src/egn/EGN.java new file mode 100644 index 0000000..01dd8ac --- /dev/null +++ b/1401417004_AtanasAvkov/Coursework/ZAD5 EGN/EGN/src/egn/EGN.java @@ -0,0 +1,118 @@ +/* +* Zada4a 5 +* Sastavete programa, koqto sravnqva dve EGN-ta i izvejda saob6tenie, koi ot pritejatelite im e po-mlad. +* Izgotvil Atanas Avkov +* FMI 1vi kurs Softuerni tehnologii (2g.) FAK # 1401417004 +* LICENSE: MIT +*/ + +package egn; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Scanner; + +public class EGN { + + public static void main(String[] args) { + String[] egnArr = getEGNs(); + System.out.println(); + compareEGNs(egnArr); + } + + private static String[] getEGNs() { + String[] egnArr = new String[2]; + String egn; + Scanner in = new Scanner(System.in); +/* +* Eto edin cikul :D +*/ + while (true) { + System.out.print("Molia vavedete purvoto EGN "); + egn = in.nextLine(); + while (!isValid(egn)) { + System.out.print(" Nevalidno EGN! Molia vavedete otnovo: "); + egn = in.nextLine(); + } + if (isValid(egn)) { + egnArr[0] = egn; + System.out.println("EGN-to koeto vavedohte e validno. "); + System.out.print("Molia vavedete vtoro EGN: "); + egn = in.nextLine(); + while (!isValid(egn)) { + System.out.print(" Nevalidno EGN molia vuvedete EGN otnovo: "); + egn = in.nextLine(); + } + if (isValid(egn)) { + egnArr[1] = egn; + System.out.println("Validno vtoro EGN "); + break; + } + } + } + in.close(); + return egnArr; + } +/* +* proverka za validnost +*/ + private static boolean isValid(String egn) { + + if (egn.length() != 10) { + return false; + } + if (!isInteger(egn)) { + return false; + } + + Date birthDay = parse(egn); + + if (birthDay.after(new Date())) { + return false; + } + return true; + } + + private static boolean isInteger(String input) { + for (int i = 0; i < input.length(); i++) { + if (!Character.isDigit(input.charAt(i))) { + return false; + } + } + return true; + } +/* +* Dparsvame datite +*/ + private static Date parse(String egn) { + + Date parsed = new Date(); + String dateString = egn.substring(0, 6); + SimpleDateFormat format = new SimpleDateFormat("yyMMdd"); + try { + parsed = format.parse(dateString); + + } catch (ParseException e) { + e.printStackTrace(); + } + return parsed; + } +/* +* sravnqvame stringovete +*/ + private static void compareEGNs(String[] egnArr) { + Date date1 = parse(egnArr[0]); + Date date2 = parse(egnArr[1]); + + if (date1.before(date2)) { + System.out.println("Chovek 1 e po-star ot 2"); + } + if (date1.after(date2)) { + System.out.println("Chovek 2 e po-star 1"); + } + if (date1.equals(date2)) { + System.out.println("I dvamata sa na edna i su6ta vuzrast"); + } + } +} \ No newline at end of file