Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package quiz;
- import java.util.Scanner;
- public class quiz {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- double resultado;
- System.out.println("Nota Quiz Uno");
- double q1 = sc.nextDouble();
- System.out.println("NoTa Quiz Dos");
- double q2 = sc.nextDouble();
- resultado = calcularNota(q1, q2);
- System.out.println(resultado);
- sc.close();
- }
- static double calcularNota(double q1, double q2) {
- double resultado;
- if (q1 > q2) {
- return resultado = (q1 * 0.7) + (q2 * 0.3)/2;
- } else if (q2 > q1) {
- return resultado = (q2 * 0.7) + (q1 * 0.3)/2;
- } else {
- return resultado = (q1 * 0.7) + (q2 * 0.3)/2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement