5. ACTIVIDAD 5
/*
* 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 pkg20.java;
import java. util. Scanner ;
/**
*
* @author David Jimenez
*/
public class Actividad_5 {
public void main (String [] args) {
Scanner leer=new Scanner (System.in);
System.out.println("Ingresa el radio");
int a;
a=leer.nextInt();
int cir, ar;
cir=(3.1416*(a*2));
ar=3.1416* a ^2;
System.out.println("La longitud es"+ cir+ "Y el area es" + ar)
}//LLave void
}// LLave final
9. ACTIVIDAD 14 (Examen)
ACTIVIDAD 15
/*
* To changethislicense header, chooseLicenseHeaders in Project Properties.
* To changethistemplate file,choose Tools | Templates
* and open thetemplate in the editor.
*/
packagepkg20.java;
import java.util.Scanner;
/**
*
* @author DavidJimenez
*/
public class Actividad_9{
public voidmain(String [] args){
Scanner leer=new Scanner(System.in);
System.out.println("Dame tu calificacion numero 1");
int a;
a=leer.nextInt();
System.out.println("Dame tu calificacion numero2");
int b;
b=leer.nextInt();
System.out.println("Dame tu calificacion numero3");
int c;
c=leer.nextInt();
if (a>b && a>c)
{
System.out.println("La calificacion mas alta es"+a);
10. }
if (b>a && b>c)
{
System.out.println("Lacalificacion mas altaes"+b);
}
if (c>a && c>b)
{
System.out.println("Lacalificacion mas altaes"+c);
}
int prom;
prom=(a+b+c)/3;
System.out.println("Tu promedio es "+prom);
if (prom>5)
{
System.out.println("Aprobado");
}
else {
System.out.println("Reprobado");
}
}
}
13. ACTIVIDAD 20
/*
* 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 pkg20.java;
import java. util. Scanner;
/**
*
* @author David Jimenez
*/
public class Actividad_20 {
public void main(String [] args){
Scanner leer=new Scanner (System.in);
System.out.println("Dame la hora");
int h;
h=leer.nextInt();
if (h>24 || h<0)
{
System.out.println("Error");
}
System.out.println("Dame los minutos");
14. int m;
m=leer.nextInt();
if (m>60 || m<0)
{
System.out.println("Error");
}
System.out.println("Dame los segundos");
int s;
s=leer.nextInt();
if (s>60 || s<0)
{
System.out.println("Error");
}
}
}