1. UNIVERSIDAD TÉCNICA DE MACHALA
FACULTAD DE INGENIERÍA CIVIL
ESCUELA DE INFORMÁTICA
CARRERA DE INGENIERÍA EN SISTEMAS
PROGRAMACION ESTRUCTURADA
AUTOR:
EDWIN EBER BELDUMA MOROCHO
PERIODO 2013 - 2014
MACHALA – EL ORO – ECUADOR
2. ESTRUCTURAREPETITIVAFOR …
Y VECTORES
• package principal;
• package casita;
• // TODO: Auto-generated Javadoc
• /**
• * The Class For.
• */
• public class For {
• /**
• * The main method.
• *
• * @param args the arguments
• */
• public static void main(String[] args) {
• int x []= new int [8];
• for (int i = 0; i < x.length; i++) {
• }
• int y=15;
• int tem = 0;
• for (int i = 0; i < y; i++) {
• tem++;
• }
• System.out.println(tem );
• }
• }
3. • public class practica1 {
• /** The sc. */
• static Scanner sc = new Scanner(System.in);
• /** The x. */
• static int x;
• /** The y. */
• static int y;
• /** The suma. */
• static int suma;
• /** The resta. */
• static int resta;
• /** The multiplicacion. */
• static int multiplicacion;
• /** The division. */
• static double division;
• /** The raiz. */
• static int raiz;
• /** The cuadrado. */
• static int cuadrado;
• /** The coseno. */
• static int coseno;
4. • /** The seno. */
• static int seno;
• /** The m1. */
• static int m1[] = new int[8];
• /** The m2. */
• static int m2[][] = new int[8][8];
• /**
• * The main method.
• *
• * @param args the arguments
• */
• public static void main(String[] args) {
• try {
• operacion();
• fort();
• } catch (Exception e) {
• }
• }
6. • /**
• * The main method.
• *
• * @param args the arguments
• */
• public static void main(String[] args) {
• Scanner scan = new Scanner(System.in);
• double spvp = 0;
• double sg = 0;
• float pvp;
• float ganan;
• int numero = 1;
• /**
• * hasta que numero sea menor igual a 4 hacer las instrucciones
• */
• while (numero <= 4) {
• System.out.println("ingrese el codigo");
• int cod = scan.nextInt();
• System.out.println("ingrese la descripcion del producto");
• Scanner teclado = new Scanner(System.in);
• String descrip;
• descrip = teclado.next();
• System.out.println("ingrese el modelo");
• String mod;
• mod = teclado.next();
• System.out.println("ingrese el precio de costo");
• float pc = scan.nextFloat();
• ganan = (float) (pc * 0.25);
• pvp = pc + ganan;
• System.out.println("el precio de venta al publico es " + pvp);
• sg = sg + ganan;
• spvp = spvp + pvp;
• numero = numero + 1;
• }
• System.out.println("la suma total de las ganancias es " + sg);
• System.out.println("la suma total del precio deventa al publico es "
• + spvp);
• }
• }