100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Ejercicios de programacion en java

Rating
-
Sold
-
Pages
17
Uploaded on
16-01-2025
Written in
2024/2025

Aquí hay varios ejercicios hechos en java con la aplicacion IntelliJ Idea para que puedas revisarlos y trabajar con ellos para aprender un poco sobre este lenguaje de programación

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Course

Document information

Uploaded on
January 16, 2025
Number of pages
17
Written in
2024/2025
Type
Class notes
Professor(s)
Anto
Contains
All classes

Subjects

Content preview

,Relación 3
EJ 1
import java.util.Scanner;

public class R3E1 {
public static void main(String[] args) {
boolean tot;
int n1, n2;
Scanner sc = new Scanner(System.in);

System.out.println("Muestra los números");

n1 = sc.nextInt();
n2 = sc.nextInt();
tot = n1==n2;

System.out.println("Los num son: " + tot);
}
}



EJ2
import java.util.Scanner;

public class R3E2 {
public static void main(String[] args) {


int n1;
boolean esPar;

Scanner sc = new Scanner(System.in);
System.out.println("Dime un numero");
n1= sc.nextInt();
esPar = (n1 % 2)==0;
System.out.println(esPar);




}

, }




EJ3
import java.util.Scanner;

public class R3E3 {

public static void main(String[] args) {
int e1, e2;
boolean juntos, separados;
Scanner sc = new Scanner(System.in);
System.out.println("Dime las edades de Gervasio y
Facundina");

e1 = sc.nextInt();
e2 = sc.nextInt();
juntos = e1 >= 18 && e2 >= 18 ;
separados = e1 >=18 ^ e2 >= 18;
System.out.println("Entran ambos" + juntos);
System.out.println("Van separados" + separados);


}
}



EJ5
import java.util.Scanner;

public class R3E5 {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

boolean esBisiesto;
int anyo;
System.out.println("Dime un año: ");
anyo = sc.nextInt();

esBisiesto = anyo %4==0 &&!(anyo%100==0 && anyo%400!=0);

System.out.println("El año es: " + esBisiesto);
R60,48
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
susanasalas

Get to know the seller

Seller avatar
susanasalas Oretania
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0,0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions