Baixe o app para aproveitar ainda mais
Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/build.xml Builds, tests, and runs the project Unidad_2_Ejemplo_1. Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/manifest.mfManifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/build/classes/.netbeans_automatic_build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/build/classes/.netbeans_update_resources Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/build/classes/unidad_2_ejemplo_1/Division.classpackage unidad_2_ejemplo_1; public synchronized class Division { public void Division(); public float Dividir(float, int); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/build/classes/unidad_2_ejemplo_1/Unidad_2_Ejemplo_1.classpackage unidad_2_ejemplo_1; public synchronized class Unidad_2_Ejemplo_1 { public void Unidad_2_Ejemplo_1(); public static void main(String[]); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/build-impl.xml 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/genfiles.propertiesbuild.xml.data.CRC32=34a457da build.xml.script.CRC32=cf158c85 build.xml.stylesheet.CRC32=8064a381@1.80.1.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=34a457da nbproject/build-impl.xml.script.CRC32=7ad2afe6 nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/project.propertiesannotation.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}/Unidad_2_Ejemplo_1.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.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 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=unidad_2_ejemplo_1.Unidad_2_Ejemplo_1 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/project.xml org.netbeans.modules.java.j2seproject Unidad_2_Ejemplo_1 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/private/private.propertiescompile.on.save=true user.properties.file=C:\\Users\\My PC\\AppData\\Roaming\\NetBeans\\8.2\\build.properties Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/nbproject/private/private.xml Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/src/unidad_2_ejemplo_1/Division.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/src/unidad_2_ejemplo_1/Division.java/* * 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 unidad_2_ejemplo_1; //nombre del paquete en donde se encuetra almacenado el archivo de la clase /** * * @author Danilo Segura */ public class Division { //Nombre de la Clase Publica public float Dividir(float dividendo, int divisor){// Metodo publico tipo floar llamado dividir //con dos parametros uno tipo float llamado Dividendo // y otro tipo int llamado divisor, que seran usados para //insertar los valores dentro del metodo Dividir. float ResultadoDivision=0;//Se declara una variable tipo float llamada ResultadoDivision igualada o inicializada //en cero (0) para evitar errores de lectura y escritura en la variable. ResultadoDivision=(dividendo/divisor); //Se almacena en la variable ResultadoDivision el valor resultante de la //operacion dividendo/divisor, esta entre parentesis por prioridad de los //operadores. return ResultadoDivision;//Se retorna el valor almacenado en la variable ResultadoDivision como respuesta del metodo //division. } } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/src/unidad_2_ejemplo_1/Unidad_2_Ejemplo_1.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_1/src/unidad_2_ejemplo_1/Unidad_2_Ejemplo_1.java/* * 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 unidad_2_ejemplo_1; //Nombre del paquete en el cual esta almacenado el archivo Unidad_2_Ejemplo_1.java /** * * @author Danilo Segura */ public class Unidad_2_Ejemplo_1 { //Nombre de la clase publica /** * @param args the command line arguments */ public static void main(String[] args) { //metodo principal de la aplicacion, es decir lo que se escriba dentro //de este metodo, se ejecutara al iniciar, arrancar o correr la aplicacion. //PUNTO DE INICIO O ARRANQUE DE LA APLICACION // TODO code application logic here Division obj = new Division(); //Se declara un objeto tipo Clase Division para acceder a los atributos y metodos //publicos de la clase Division. float a=5;//se declara una variable tipo float llamada "a" inicializada en 5 que cumplira el papel de dividendo. int b=2; //se declara una variable tipo int llamada "b" inicializada en 2 que cumplira el papel de divisor. //Si desea puede cambiar los valores de a y b para obtener nuevos resultados. float c=0;//se declara unavarible tipo float llamada "c" inicializada en 0 donde se almacenara el resultado. c=obj.Dividir(a, b);//Se almacena en la varible c el resultado del metodo Dividir invocado a traves del objeto obj, //pasando los atributos a y b, de tipo Floar e int respectivamente, asi como se declaro en la //clase Division. System.out.println(c);// Se imprime en consola el valor de c, aunque la variable "c" no es completamente necesaria //en la aplicacion ya que se podria invocar el metodo dividir de la siguieten forma: //System.out.println(obj.Dividir(a, b)); //y se mostraria el resultado de igual forma. } } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/build.xml Builds, tests, and runs the project Unidad_2_Ejemplo_2. Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/manifest.mfManifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/build/classes/.netbeans_automatic_build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/build/classes/.netbeans_update_resources Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/build/classes/unidad_2_ejemplo_2/Edad.classpackage unidad_2_ejemplo_2; public synchronized class Edad { private int edadPersona; public void Edad(); public void SetedadPersona(int); public int GetedadPersona(); public void Comprobar(); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/build/classes/unidad_2_ejemplo_2/Unidad_2_Ejemplo_2.classpackage unidad_2_ejemplo_2; public synchronized class Unidad_2_Ejemplo_2 { public void Unidad_2_Ejemplo_2(); public static void main(String[]); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/build-impl.xml 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/genfiles.propertiesbuild.xml.data.CRC32=2c90c3b0 build.xml.script.CRC32=e2c5763e build.xml.stylesheet.CRC32=8064a381@1.80.1.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=2c90c3b0 nbproject/build-impl.xml.script.CRC32=b9b169ea nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/project.propertiesannotation.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}/Unidad_2_Ejemplo_2.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.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 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=unidad_2_ejemplo_2.Unidad_2_Ejemplo_2 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/project.xml org.netbeans.modules.java.j2seproject Unidad_2_Ejemplo_2 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/private/private.propertiescompile.on.save=true user.properties.file=C:\\Users\\My PC\\AppData\\Roaming\\NetBeans\\8.2\\build.properties Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/nbproject/private/private.xml Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/src/unidad_2_ejemplo_2/Edad.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/src/unidad_2_ejemplo_2/Edad.java/* * 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 unidad_2_ejemplo_2; //Nombre del paquete en el cual esta almacenado el archivo Edad.java /** * * @author Danilo Segura */ public class Edad {//Nombre de la clase publica private int edadPersona;//Se declara una variable privada tipo int llamada edadPersona, Esta variable privada //solo se puede usar dentro de la clase Edad. public Edad(){//metodo contructor de la clase Edad. edadPersona=0;//Se inicializa la variable edadPersona en 0 para evidar errores de lectura y escritura. } public void SetedadPersona(int dato){//Metodo modificador del atributo edadPersona, este metodo se crea con la finalidad //de poder modificar la varible edadPersona desde otras instancias de la aplicacion. //En este caso el metodo es publico tipo void y se le para como parametro un dato //tipo int de nombre Dato. edadPersona=dato;//Se le asigna a la variable edadPersona el valor pasado como parametro dato. } public int GetedadPersona(){//Se crea un metodo tipo publico tipo int (es decir retornar un valor tipo int)con nombre //GetedadPersona, con la finalidad de obtener el valor almacenado en la variable //edadPersona desde otras instancias de la aplicacion, al invocar este metodo retornara el //valor almacenado en la variable edadPersona. return edadPersona; //Se retorna el valor de edadPersona. } public void Comprobar(){//metodo publico tipo void(Si retorno) con el nombre comprobar, este metodo compruebala edad //digitada por el usuario. int edad=GetedadPersona();//se obtiene el valor de la variable edadPersonas por medio del metodo GetedadPersona y se //almacena el la variable tipo int llamada edad. if(edad>=18){//condicional simple que evalua si el numero almacenado en variable edad es mayor o igual que 18, System.out.println("Usted es mayor de Edad");//si esta condicion se cumple se muestra el mensaje "Usted es mayor de Edad". //por medio de la libreria System. } } } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/src/unidad_2_ejemplo_2/Unidad_2_Ejemplo_2.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_2/src/unidad_2_ejemplo_2/Unidad_2_Ejemplo_2.java/* * 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 unidad_2_ejemplo_2; //nombre del paquete en el cual esta almacenado el archivo Unidad_2_Ejemplo_2.java import java.util.Scanner; //libreria Scanner para poder leer los caracteres digitados por teclado en la consola. /** * * @author Danilo Segura */ public class Unidad_2_Ejemplo_2 {//Nombre de la clase publica /** * @param args the command line arguments */ public static void main(String[] args) { //metodo principal main, desde este punto arranca la aplicacion, toda linea de //codigo puesta en este punto se ejecutara al iniciar la aplicacion. // TODO code application logic here Scanner Leer = new Scanner(System.in);//Se crea un objeto tipo Scanner llamado Leer, para capturar los datos //ditados por teclado en la consola. Edad obj = new Edad();//Se crea un objeto tipo Edad llamado obj para acceder a los metodos y atributos publicos de //la clase Edad. int edad=0;//Se declara una varibale tipo int llamada edad y se inicializa en 0 para evitar errores de lectura y escritura. System.out.println("Digite Su edad:"); //se muestra en consola un mensaje "Digite Su edad" y a continuacion la aplicacion edad=Integer.parseInt(Leer.nextLine()); //espera los datos digitados por el usuario y capturarlos por medio de la seccion //Leer.nextLine() para posteriormente convertir los datos por medio de la seccion //Integer.parseInt(...) y asi almacenarlo en la variable edad. obj.SetedadPersona(edad);//se modifica el valor de la variable edadPersona en la Clase Edad, invocando el metodo //SetedadPersona por medio del objeto obj, y se pasa por parametro el dato edad. obj.Comprobar();//se invoca el metodo Comprobar de la clase edad por medio del objeto obj declarado previamente. } } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/build.xml Builds, tests, and runs the project Unidad_2_Ejemplo_3. Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/manifest.mfManifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/build/classes/.netbeans_automatic_build Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/build/classes/.netbeans_update_resources Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/build/classes/unidad_2_ejemplo_3/Edad.classpackage unidad_2_ejemplo_3; public synchronized class Edad { private int edadPersona; public void Edad(); public void SetedadPersona(int); public int GetedadPersona(); public String Comprobar(int); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/build/classes/unidad_2_ejemplo_3/Unidad_2_Ejemplo_3.classpackage unidad_2_ejemplo_3; public synchronized class Unidad_2_Ejemplo_3 { public void Unidad_2_Ejemplo_3(); public static void main(String[]); } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/build-impl.xml 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/genfiles.propertiesbuild.xml.data.CRC32=24834f96 build.xml.script.CRC32=4f5a2268 build.xml.stylesheet.CRC32=8064a381@1.80.1.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=24834f96 nbproject/build-impl.xml.script.CRC32=f8902bee nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/project.propertiesannotation.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}/Unidad_2_Ejemplo_3.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.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 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=unidad_2_ejemplo_3.Unidad_2_Ejemplo_3 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 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/project.xml org.netbeans.modules.java.j2seproject Unidad_2_Ejemplo_3 Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/private/private.propertiescompile.on.save=true user.properties.file=C:\\Users\\My PC\\AppData\\Roaming\\NetBeans\\8.2\\build.properties Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/nbproject/private/private.xml file:/G:/MONOGRAFIA/Ejercicios/Unidad_2_Ejemplo_3/src/unidad_2_ejemplo_3/Edad.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/src/unidad_2_ejemplo_3/Edad.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/src/unidad_2_ejemplo_3/Edad.java/* * 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 unidad_2_ejemplo_3; //Nombre del paquete en el cual esta almacenado el archivo Edad.java /** * * @author Danilo Segura */ public class Edad {//Nombre de la clase publica private int edadPersona;//Se declara una variable privada tipo int llamada edadPersona, Esta variable privada //solo se puede usar dentro de la clase Edad. public Edad(){//metodo constructor de la clase Edad. edadPersona=0;//Se inicializa la variable edadPersona en 0 para evitar errores de lectura y escritura. } public void SetedadPersona(int dato){//Metodo modificador del atributo edadPersona, este metodo se crea con la finalidad //de poder modificar la varible edadPersona desde otras instancias de la aplicacion. //En este caso el metodo es publico tipo void y se le pasa como parametro un dato //tipo int de nombre dato. edadPersona=dato;//Se le asigna a la variable edadPersona el valor pasado como parametro dato. } public int GetedadPersona(){//Se crea un metodo tipo publico tipo int (es decir retornar un valor tipo int)con nombre //GetedadPersona, con la finalidad de obtener el valor almacenado en la variable //edadPersona desde otras instancias de la aplicacion, al invocar este metodo retornara el //valor almacenado en la variable edadPersona. return edadPersona; //Se retorna el valor de edadPersona. } public String Comprobar(int edad){//metodo publico tipo void(Sin retorno) con el nombre comprobar, este metodo comprueba la edad //digitada por el usuario. //almacena el la variable tipo int llamada edad. if(edad>=18){//condicional simple que evalua si el numero almacenado en variable edad es mayor o igual que 18, return ("Felicitaciones eres mayor de edad");//si esta condicion se cumple se muestra el mensaje "Usted es mayor de Edad". //por medio de la libreria System. }else{//aqui aplicamos el bloque else, con este podemos hacer una accion distinta si la condicion no se cumple. return("Lo sentimos no eres mayor de edad");//si la condicion no se cumple se muestra el mensaje //"Lo sentimos no eres mayor de edad". } } } Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/src/unidad_2_ejemplo_3/Unidad_2_Ejemplo_3.java Recurso Ejercicios Unidad 2/Unidad_2_Ejemplo_3/src/unidad_2_ejemplo_3/Unidad_2_Ejemplo_3.java/* * 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 unidad_2_ejemplo_3; import java.util.Scanner; /** * * @author Danilo Segura */ public class Unidad_2_Ejemplo_3 { /** * @param args the command line arguments */ public static void main(String[] args) {//metodo principal main, desde este punto arranca la aplicacion, toda linea de //codigo puesta en este punto se ejecutara al iniciar la aplicacion. // TODO code application logic here Scanner Leer = new Scanner(System.in);//Se crea un objeto tipo Scanner llamado Leer, para capturar los datos //ditados por teclado en la consola. Edad obj = new Edad();//Se crea un objeto tipo Edad llamado obj para acceder a los metodos y atributos publicos de //la clase Edad. int edad=0;//Se declara una varibale tipo int llamada edad y se inicializa en 0 para evitar errores de lectura y escritura. System.out.println("Digite Su edad:"); //se muestra en consola un mensaje "Digite Su edad" y a continuacion la aplicacion edad=Integer.parseInt(Leer.nextLine()); //espera los datos digitados por el usuario para capturarlos por medio de la seccion //Leer.nextLine() para posteriormente convertir los datos por medio de la seccion //Integer.parseInt(...) y asi almacenarlo en la variable edad. obj.SetedadPersona(edad);//se modifica el valor de la variable edadPersona en la Clase Edad, invocando el metodo //SetedadPersona por medio del objeto obj, y se pasa por parametro el dato edad. String Respuesta = obj.Comprobar(obj.GetedadPersona());//se invoca el metodo Comprobar de la clase edad por medio del objeto obj declarado previamente. System.out.println(Respuesta); } } Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/build.xml Builds, tests, and runs the project Unidad_2_ejemplo_4. Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/manifest.mfManifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/build/classes/.netbeans_automatic_build Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/build/classes/.netbeans_update_resources Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/build/classes/unidad_2_ejemplo_4/Etapas.classpackage unidad_2_ejemplo_4; public synchronized class Etapas { public void Etapas(); public String Etapa(int); } Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/build/classes/unidad_2_ejemplo_4/Unidad_2_ejemplo_4.classpackage unidad_2_ejemplo_4; public synchronized class Unidad_2_ejemplo_4 { public void Unidad_2_ejemplo_4(); public static void main(String[]); } Recurso Ejercicios Unidad 2/Unidad_2_ejemplo_4/nbproject/build-impl.xml
Compartilhar