100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Ejercicios clases de equivalencia $8.07   Add to cart

Other

Ejercicios clases de equivalencia

 7 views  0 purchase
  • Course
  • Institution

Ejercicios clases de equivalencia del tema 3: Diseño y realización de pruebas de la asignatura entornos de desarrollo del CFGS Desarrollo de aplicaciones multiplataforma

Preview 2 out of 7  pages

  • April 7, 2024
  • 7
  • 2021/2022
  • Other
  • Unknown
avatar-seller
Ejercicio 1:
public class Principal {
public String f(int edad, String tipo, String DNI) {
if(edad>=0 && edad<125) {
return(null);
}

if(!((tipo.equals("alumno"))||(tipo.equals("profesor")||(tipo.equals("tutor"))))) {
return(null);
}
if(DNI.length()!=9) {
return(null);
}else {

}

}
}

//clases de equivalencia

//edad
//CV1_EDAD: si edad está entre 0 y 125
//CNV_EDAD: si edad es menor que 0
//CNV_EDAD: si edad es mayor que 125

//TIPO
//CV1_TIPO: si tipo es 'alumno'
//CV2_TIPO: si tipo es 'profesor'
//CV3_TIPO: si tipo es 'tutor'
//CNV:_TIPO si tipo no es ni 'alumno' ni 'profesor' ni 'tutor'

//DNI

//16599456F: 9 caracteres y además la letra debe ser rescatada a partir de los 8
dígitos previos
//CV1_DNI: si se cumple 9 caracteres y además la letra debe ser rescatada a partir de
los 8 dígitos previos
//CNV1_DNI: cualquier cadena que no tenga 9 caracteres
//CNV2_DNI: conjunto de 9 caracteres pero la letra no es rescatada a partir de los 8
dígitos previos --> DNI con la letra mal
//CNV3_DNI: si alguno de los 8 primeros caracteres no es un dígito


//CP1: CV1_EDAD, CV1_TIPO, CV1_DNI --> funcion(30, "alumno", "50484288R") -->
RE: R
//CP2: CV1_EDAD, CV2_TIPO, CV1_DNI --> funcion(30, "alumno", "50484288R") -->
RE: R
//CP3: CV1_EDAD, CV3_TIPO, CV1_DNI --> funcion(30, "tutor", "50484288R") --> RE:
R
//CP4: CV1_EDAD, CNV1_TIPO, CV1_DNI --> funcion(30, "jefe", "50484288R") -->
RE: null

, Ejercicio 2:
public class Principal2 {
public static void main(String[] args) {
int[] numeros=new int[]{1,2};
System.out.println(funcion(numeros));
numeros=new int[]{1,2,3};
System.out.println(funcion(numeros));
numeros=new int[]{1,2,3,4};
System.out.println(funcion(numeros));
numeros=new int[]{1,2,3,4,5,6,7,8};
System.out.println(funcion(numeros));
numeros=new int[]{1,2,3,4,5,6,7,8,9};
System.out.println(funcion(numeros));
numeros=new int[]{1,2,3,4,5,6,7,8,9,10};
System.out.println(funcion(numeros));
}

public static double funcion(int[] notas) {
int tamano=notas.length;
double suma=0;
if((tamano>=3)&&(tamano<=9)) {
for(int i=0; i<tamano; i++) {
suma=suma+notas[i];
}
return((double)suma/tamano);
}
return(-1);
}

//CP1: 2 notas media(int[] numeros=new int[]{1,2}) --> RE: -1
//CP2: 3 notas media(int[] numeros=new int[]{1,2,3}) --> RE: 2
//CP3: 4 notas media(int[] numeros=new int[]{1,2,3,4}) --> RE: 2,5
//CP4: 8 notas media(int[] numeros=new int[]{1,2,3,4,5,6,7,8}) --> 4,5
//CP5: 9 notas media(int[] numeros=new int[]{1,2,3,4,5,6,7,8,9})--> RE: 5
//CP6: 10 notas media(int[] numeros=new int[]{1,2,3,4,5,6,7,8,9,10})--> RE: -1
}

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller saragonzalo. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $8.07. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80435 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.07
  • (0)
  Add to cart