Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ================================
- CLASE HELPER DEL GRUPO 02
- ================================
- */
- package ar;
- import java.util.Scanner;
- public class HelperEjer3 {
- //------------------- Metodos para validar -------------------//
- public static int validarNumero(String mensaje, String mensajeError) {
- Scanner input = new Scanner(System.in);
- while (true) {
- try {
- System.out.println(mensaje);
- return Integer.parseInt(input.nextLine());
- } catch (NumberFormatException e) {
- System.out.println(mensajeError);
- }
- }
- }//finvalidarNumero
- //------------------- Metodo expuesto para el ejer3 -------------------//
- public static double SumRoorN(int root) {
- double result =0;
- for (int i = 0; i < 10000000; i++) {
- result+= Math.exp(Math.log(i)/root);
- }
- return result;
- }//finSumRoorN
- }
Add Comment
Please, Sign In to add comment