Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.lang.Math;
- import java.util.Scanner;
- public class Problem4 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double a = scanner.nextDouble();
- double b = scanner.nextDouble();
- double c = scanner.nextDouble();
- double firstNumber = f1(a,b,c);
- System.out.printf("F1 result: "%.2f%n", firstNumber);
- double secondNumber = f2(a,b,c);
- System.out.printf("F2 result: "%.2f%n", secondNumber );
- }
- public static double f1(double a, double b, double c) {
- double first = Math.pow(a, 2) + Math.pow(b, 2);
- double second = Math.pow(a, 2) - Math.pow(b, 2);
- double third = first / second;
- double fourth = (a + b + c);
- double fifth = fourth / Math.pow(c, 0.5);
- double sixth = Math.pow(third, fifth);
- return sixth;
- }
- public static double f2(double a, double b, double c) {
- double first = Math.pow(a, 2) + Math.pow(b, 2) - Math.pow(c, 3);
- double second = (a - b);
- double third = Math.pow(first, second);
- return third;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement