Sunteți pe pagina 1din 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 javaapplication2;
import java.util.Scanner;
/**
*
* @author USUARIO-08
*/
public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner variables=new Scanner(System.in);
Scanner var=new Scanner(System.in);
double precion=0,ganancia=0,acugan=0,nota=0,auxmayor=0,auxmenor=6,acun=0,pro
medio=0,preciot=0;
String otroart;
int i,opcion;
System.out.println("Elija una opcion:");
System.out.println("1. Calcular ganancia de un producto");
System.out.println("2. Las notas");
System.out.println("3. Salir");
opcion=variables.nextInt();
if(opcion==1){
otroart="s";
while(otroart.equals("s")){
System.out.println("Ingrese precio neto del articulo");
precion=variables.nextInt();
ganancia=(precion*0.30);
preciot=precion+ganancia;
acugan=acugan+ganancia;
System.out.println("Hay otro articulo?");
otroart=var.nextLine();
}
System.out.println("El total de ganancias fue: "+acugan);
}
if(opcion==2){
for(i=0;i<5;i++){
System.out.println("Ingrese nota");
nota=variables.nextInt();
acun=acun+nota;
if(nota<auxmenor){
auxmenor=nota;
}
if(nota>auxmayor){
auxmayor=nota;
}
}
promedio=acun/5;
System.out.println("El promedio de sus notas es: "+promedio);
System.out.println("La nota mayor fue: "+auxmayor);
System.out.println("La nota menor fue: "+auxmenor);
}
if(opcion==3){

System.out.println("Usted ha salido del sistema");


}
}
}

S-ar putea să vă placă și