Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class clase {
- public static void main(String[] args) {
- //Scanner s = new Scanner(System.in);
- //String nom = s.nextLine();
- //mostrar(nom);
- double aleatorio = aleat();
- double aleatorio2 = aleat();
- double res = sumar(aleatorio, aleatorio2);
- System.out.println(aleatorio + " + " + aleatorio2+ " = " + res);
- mostrar("Marc");
- System.out.println();
- double a = sumar(3.4, 5.8);
- System.out.println(a);
- }
- public static double sumar(double a, double b){
- return a+b;
- }
- public static double aleat() {
- return Math.random()*10;
- }
- public static void mostrar(String nom) {
- System.out.println("Me llamo " + nom);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement