You are on page 1of 15

RICARDO FABRICIO MUÑOZ QUINATOA

TEMA:

EXAMEN PARCIAL

MATEMATICA SUPERIOR
ING. EDGAR FABIAN MONTALUISA
PILATASIG
Código fuente
Modelo Ecuación Grado 1
/*
* 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 bean;

import java.util.Vector;

/**
*
* @author labctr
*/
public class ecuacionPrimergrado {
private int id;
private double ax;
private double b;
private double x1;

public ecuacionPrimergrado(int id, double ax, double b, double x1) {


this.id = id;
this.ax = ax;
this.b = b;
this.x1 = x1;
}

public ecuacionPrimergrado(int id) {


this.id = id;
}

public ecuacionPrimergrado() {
}

public int getId() {


return id;
}

public void setId(int id) {


this.id = id;
}

public double getAx() {


return ax;
}

public void setAx(double ax) {


this.ax = ax;
}
public double getB() {
return b;
}

public void setB(double b) {


this.b = b;
}

public double getX1() {


return x1;
}

public void setX1(double x1) {


this.x1 = x1;
}

public static double raizX(double ax, double b){


double raiz;
raiz = -b/ax;
return raiz;
}

public static void tabla(double ax, double b){


double y;
Vector vector=new Vector();
for(int i=-20;i<20;i++){
y = ax*i + b;
vector.addElement(y);
}
}
}

Modelo Grado 2

/*
* 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 bean;

import java.util.Vector;

/**
*
* @author labctr
*/
public class ecuacionSegundogrado {
private int id;
private double ax;
private double bx;
private double c;
private double x1;
private double x2;

public ecuacionSegundogrado(int id, double ax, double bx, double c, double x1, double x2) {
this.id = id;
this.ax = ax;
this.bx = bx;
this.c = c;
this.x1 = x1;
this.x2 = x2;
}

public ecuacionSegundogrado(int id) {


this.id = id;
}

public ecuacionSegundogrado() {
}

public int getId() {


return id;
}

public void setId(int id) {


this.id = id;
}

public double getAx() {


return ax;
}

public void setAx(double ax) {


this.ax = ax;
}

public double getBx() {


return bx;
}

public void setBx(double bx) {


this.bx = bx;
}

public double getC() {


return c;
}

public void setC(double c) {


this.c = c;
}

public double getX1() {


return x1;
}

public void setX1(double x1) {


this.x1 = x1;
}

public double getX2() {


return x2;
}

public void setX2(double x2) {


this.x2 = x2;
}

public static double raizX1(double ax, double bx, double c){


double raiz;
double parte = Math.sqrt(((bx*bx)-4*ax*c));
raiz = ((-bx + parte)/(2*ax));
return raiz;
}

public static double raizX2(double ax, double bx, double c){


double raiz;
double parte = Math.sqrt(((bx*bx)-4*ax*c));
raiz = ((-bx - parte)/(2*ax));
return raiz;
}

public static void tabla(double ax, double bx, double c){


double y;
Vector vector=new Vector();
for(int i=-20;i<20;i++){
y = ax*(i*i) + bx*i + c;
vector.addElement(y);
}
}
}

Controlador Ecuación Grado Uno


/*
* 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 controller;
import bean.ecuacionPrimergrado;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
*
* @author labctr
*/
@Controller
public class ecuacionPrimergradoController {
@RequestMapping(value = "/gradouno/ecuacion.htm", method = RequestMethod.GET)
public String createDistancia(Model m){
return "/gradouno/form";
}

@RequestMapping(value = "/gradouno/ecuacion.htm", method = RequestMethod.POST)


public String createDistancia(@RequestParam("ax") double ax,
@RequestParam("b") double b,
Model m){
ecuacionPrimergrado ecuagraduno = new ecuacionPrimergrado();
ecuagraduno.setAx(ax);
ecuagraduno.setB(b);
double raiz = ecuagraduno.raizX(ax, b);
ecuagraduno.setX1(raiz);
m.addAttribute("ecuagraduno", ecuagraduno);
return "/gradouno/list";
}
}
Controlador Ecuación Grado Dos

/*
* 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 controller;

import bean.ecuacionSegundogrado;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
*
* @author labctr
*/
@Controller
public class ecuacionSegundogradoController {
@RequestMapping(value = "/gradodos/ecuacion.htm", method = RequestMethod.GET)
public String createDistancia(Model m){
return "/gradodos/form";
}

@RequestMapping(value = "/gradodos/ecuacion.htm", method = RequestMethod.POST)


public String createDistancia(@RequestParam("ax") double ax,
@RequestParam("bx") double bx,
@RequestParam("c") double c,
Model m){
ecuacionSegundogrado ecuagrados = new ecuacionSegundogrado();
ecuagrados.setAx(ax);
ecuagrados.setBx(bx);
ecuagrados.setC(c);
double raiz1 = ecuagrados.raizX1(ax, bx, c);
double raiz2 = ecuagrados.raizX2(ax, bx, c);
ecuagrados.setX1(raiz1);
ecuagrados.setX2(raiz2);
m.addAttribute("ecuagrados", ecuagrados);
return "/gradodos/list";
}
}

Vistas Ecuación Grado 1

<%--
Document : form
Created on : 26/05/2019, 17:00:07
Author : Endevour
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Movimiento Rectilineo Uniforme</title>
<link rel="icon" href="../img/Fisica.ico" type="image/x-icon" />
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link href="../css/materialize.css" rel="stylesheet" type="text/css"/>
<!-- Compiled and minified JavaScript -->
<script src="../js/materialize.js" type="text/javascript"></script>
</head>
<body>
<nav>
<div class="nav-wrapper" style="background:linear-gradient(30deg, crimson,sienna,
royalblue, indianred, purple);">
<a href="index.html" class="brand-logo">Ecuaciones</a>
<ul class="right hide-on-med-and-down">
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1"
>Ecuaciones<i class="material-icons right">account_balance</i></a></li>
</ul>
</div>
</nav>
<ul id="dropdown1" class="dropdown-content" style="background:linear-
gradient(30deg, crimson,sienna, royalblue, indianred, purple);">
<li><a class="waves-effect waves-light white-text"
href="../gradouno/ecuacion.htm">Ecuacion De Primer Grado<i class="material-icons
left">group</i></a></li>
<li><a class="waves-effect waves-light white-text"
href="../gradodos/ecuacion.htm">Ecuacion De Segundo Grado<i class="material-icons
left">group</i></a></li>
</ul>
<div class="center-align">

<h4> <em> Ecuacion </em> </h4>

</div>
<div class="container">
<div>
<h4>Ecuacion de primer grado</h4>
<h5>Calculo De Raices</h5>
<form action="ecuacion.htm" method="POST">
<fieldset>

<!-- Creando un nuevo registro -->

<label>Coeficiente de x^2: </label>


<input id="ax" name="ax" placeholder="Ingrese un termino que contenga x^2" />
<br/>
<label>Coeficiente de x: </label>
<input id="bx" name="bx" placeholder="Ingrese un termino que contenga x" />
<br/>
<label>Termino independiente: </label>
<input id="c" name="c" placeholder="Ingrese un termino independiente" />
<br/>
<input type="reset" value="Cancelar" />
<input type="submit" value="Enviar" name="command" />

</fieldset>
</form>
</div>
</div>
</body>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.dropdown-trigger');
var instances = M.Dropdown.init(elems);
});
</script>
</html>

<%--
Document : list
Created on : 26/05/2019, 17:19:25
Author : Endevour
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Movimiento Rectilineo Uniforme</title>
<link rel="icon" href="../img/Fisica.ico" type="image/x-icon" />
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link href="../css/materialize.css" rel="stylesheet" type="text/css"/>
<!-- Compiled and minified JavaScript -->
<script src="../js/materialize.js" type="text/javascript"></script>
</head>
<body>
<nav>
<div class="nav-wrapper" style="background:linear-gradient(30deg, crimson,sienna,
royalblue, indianred, purple);">
<a href="index.html" class="brand-logo">Ecuaciones</a>
<ul class="right hide-on-med-and-down">
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1"
>Ecuaciones<i class="material-icons right">account_balance</i></a></li>
</ul>
</div>
</nav>
<ul id="dropdown1" class="dropdown-content" style="background:linear-
gradient(30deg, crimson,sienna, royalblue, indianred, purple);">
<li><a class="waves-effect waves-light white-text"
href="../gradouno/ecuacion.htm">Ecuacion De Primer Grado<i class="material-icons
left">group</i></a></li>
<li><a class="waves-effect waves-light white-text"
href="../gradodos/ecuacion.htm">Ecuacion De Segundo Grado<i class="material-icons
left">group</i></a></li>
</ul>
<div class="center-align">

<h4> <em> Ecuacion </em> </h4>

</div>
<div class="container">
<div>
<h4>Ecuacion De Primer Grado</h4>
<h5>Datos De Calculos</h5>
<fieldset>
<label>a: </label>
<span>${requestScope.ecuagrados.ax} </span>
<br/>
<label>b: </label>
<span>${requestScope.ecuagrados.bx} </span>
<br/>
<label>c: </label>
<span>${requestScope.ecuagrados.c} </span>
<br/>
<label>Raiz x2: </label>
<span>${requestScope.ecuagrados.x2} </span>
<br/>
<label>Raiz x1: </label>
<span>${requestScope.ecuagrados.x1} </span>
</fieldset>
</div>
</div>
</body>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.dropdown-trigger');
var instances = M.Dropdown.init(elems);
});
</script>
</html>

Vistas Ecuación Grado 2

<%--
Document : form
Created on : 26/05/2019, 17:00:07
Author : Endevour
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Movimiento Rectilineo Uniforme</title>
<link rel="icon" href="../img/Fisica.ico" type="image/x-icon" />
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link href="../css/materialize.css" rel="stylesheet" type="text/css"/>
<!-- Compiled and minified JavaScript -->
<script src="../js/materialize.js" type="text/javascript"></script>
</head>
<body>
<nav>
<div class="nav-wrapper" style="background:linear-gradient(30deg, crimson,sienna,
royalblue, indianred, purple);">
<a href="index.html" class="brand-logo">Ecuaciones</a>
<ul class="right hide-on-med-and-down">
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1"
>Ecuaciones<i class="material-icons right">account_balance</i></a></li>
</ul>
</div>
</nav>
<ul id="dropdown1" class="dropdown-content" style="background:linear-
gradient(30deg, crimson,sienna, royalblue, indianred, purple);">
<li><a class="waves-effect waves-light white-text"
href="../gradouno/ecuacion.htm">Ecuacion De Primer Grado<i class="material-icons
left">group</i></a></li>
<li><a class="waves-effect waves-light white-text"
href="../gradodos/ecuacion.htm">Ecuacion De Segundo Grado<i class="material-icons
left">group</i></a></li>
</ul>
<div class="center-align">

<h4> <em> Ecuacion </em> </h4>

</div>
<div class="container">
<div>
<h4>Ecuacion de primer grado</h4>
<h5>Calculo De Raices</h5>
<form action="ecuacion.htm" method="POST">
<fieldset>

<!-- Creando un nuevo registro -->

<label>Coeficiente de x: </label>
<input id="ax" name="ax" placeholder="Ingrese un termino que contenga x" />
<br/>
<label>Termino independiente: </label>
<input id="b" name="b" placeholder="Ingrese un termino independiente" />
<br/>
<input type="reset" value="Cancelar" />
<input type="submit" value="Enviar" name="command" />

</fieldset>
</form>
</div>
</div>
</body>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.dropdown-trigger');
var instances = M.Dropdown.init(elems);
});
</script>
</html>
<%--
Document : list
Created on : 26/05/2019, 17:19:25
Author : Endevour
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Movimiento Rectilineo Uniforme</title>
<link rel="icon" href="../img/Fisica.ico" type="image/x-icon" />
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link href="../css/materialize.css" rel="stylesheet" type="text/css"/>
<!-- Compiled and minified JavaScript -->
<script src="../js/materialize.js" type="text/javascript"></script>
</head>
<body>
<nav>
<div class="nav-wrapper" style="background:linear-gradient(30deg, crimson,sienna,
royalblue, indianred, purple);">
<a href="index.html" class="brand-logo">Ecuaciones</a>
<ul class="right hide-on-med-and-down">
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1"
>Ecuaciones<i class="material-icons right">account_balance</i></a></li>
</ul>
</div>
</nav>
<ul id="dropdown1" class="dropdown-content" style="background:linear-
gradient(30deg, crimson,sienna, royalblue, indianred, purple);">
<li><a class="waves-effect waves-light white-text"
href="../gradouno/ecuacion.htm">Ecuacion De Primer Grado<i class="material-icons
left">group</i></a></li>
<li><a class="waves-effect waves-light white-text"
href="../gradodos/ecuacion.htm">Ecuacion De Segundo Grado<i class="material-icons
left">group</i></a></li>
</ul>
<div class="center-align">

<h4> <em> Ecuacion </em> </h4>

</div>
<div class="container">
<div>
<h4>Ecuacion De Primer Grado</h4>
<h5>Datos De Calculos</h5>
<fieldset>
<label>ax: </label>
<span>${requestScope.ecuagraduno.ax} </span>
<br/>
<label>b: </label>
<span>${requestScope.ecuagraduno.b} </span>
<br/>
<label>Raiz: </label>
<span>${requestScope.ecuagraduno.x1} </span>
</fieldset>
</div>
</div>
</body>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.dropdown-trigger');
var instances = M.Dropdown.init(elems);
});
</script>
</html>

Corrido De Aplicativo

You might also like