Skip to content

Instantly share code, notes, and snippets.

@baesparza
Last active June 14, 2017 16:41
Show Gist options
  • Save baesparza/5191e49fee572e17696940f943df113f to your computer and use it in GitHub Desktop.
Save baesparza/5191e49fee572e17696940f943df113f to your computer and use it in GitHub Desktop.
package calculo.de.matricula;
import java.util.Scanner;
/**
* @author baesparza jahurtadod
*/
public class CalculoDeMatricula {
public static double v_credito = 0;
public static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
float total = (float) descuentoBecas((int) (ciclo()+valorCreditos()));
System.out.print("El valor a pagar es: "+total);
}
public static float ciclo() {
System.out.print("Ingrese el ciclo academico: ");
int ciclo = input.nextInt();
float matricula = 700 + ((ciclo - 1) * 10);
return matricula;
}
public static float valorCreditos() {
System.out.print("Ingrese el numero de materias troncales: ");
int troncales = input.nextInt();
System.out.print("Ingrese el numero de materias basicas: ");
int basicas = input.nextInt();
float resultado = 0;
resultado = ((troncales * 4 * 35)+(basicas * 3 * 35 ));
return resultado;
}
public static double descuentoBecas (int resultado){
Scanner input = new Scanner(System.in);
double descuento = 0, total = 0;
System.out.println("Seleccione su tipo de beca: ");
System.out.println(" 1-Por meritos academicos\n 2-Beca Familiar\n 5-No tiene beca");
int op = input.nextInt();
switch (op){
case (1):
descuento = 0.15;
break;
case (2):
descuento = 0.08;
break;
default:
descuento = 0;
break;
}
total = (resultado-(resultado*descuento)) * 1.14;
return total;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment