write the class name please Declarations 2 points 12 The fir


write the class name please.

Declarations 2 points 12) The first numbers of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21. 34, 55, 89, 144,... Each number is calculated by adding the previous two Processing 5paints numbers, write a program that asks the user how many numbers of the Cupu Compilation 2 points Fibonacci sequence wants to see, and then it shows the mbers in the 2 points sequence. (15 points) 2 points write a program to calculate the hypotenuse of a right-angled triangle Program struct point given the other two sides. The program should use three methods: one to ask the user for the values of the two sides, a second method to calculate the Method def 6points hypotenuse, and a third to display the output. (15 points) 2 points Extra-credit 2points program that allows a user to enter the temperature of the seven 14) Write a Points days of a given week, and stores those values in an array of doubles. The Input program should produce the average temperature for the week, the maximum Maximum temperature for the week and the minimum temperature for the week. (15 Minimum points) Extra-resdir e2 points). If your program is not working, identify which part of Running the program is causing the problems? you were allowed one question like TOTAL ered How can I do Which question would you ask?

Solution

Hi, friend you have not mentioned about Programming Language, but you asked for Class.

So,I have answered in Java.

I habe answered first two questions.

Please repost others in separate post.

Please let me know in case of any issue.

1)

import java.util.Scanner;

public class Fibonacci {

  

   public static void main(String[] args) {

      

       Scanner sc = new Scanner(System.in);

      

       System.out.print(\"How many of fibonacci sequence numbers \");

       int n = sc.nextInt();

      

       if(n==1){

           System.out.println(0);

       }

       else if(n == 2){

           System.out.println(0+\" \"+1);

       }

       else{

           // if n > 2

           System.out.print(0+\" \"+1+\" \");

           int f1= 0, f2 = 1;

           // iterate to calculate 3rd to nth element

           for(int i=3; i<=n; i++){

               int f = f1+f2;

               System.out.print(f+\" \");

               f1 = f2;

               f2 = f;

           }

       }

   }

}

/*

Sample run:

How many of fibonacci sequence numbers 10

0 1 1 2 3 5 8 13 21 34

*/

2)

import java.util.Scanner;

public class Hypotanous {

  

   static Scanner sc = new Scanner(System.in);

  

   // function to get side of a triangle

   public static double getSide(){

       System.out.print(\"Enter side: \");

       double side = sc.nextDouble();

      

       return side;

   }

  

   public static double getHypotanous(double side1, double side2){

      

       return Math.sqrt(side1*side1 + side2*side2);

   }

  

   public static void display(double h){

       System.out.println(\"hypotanous: \"+h);

   }

  

   public static void main(String[] args) {

      

       double side1 = getSide(); // getting side1

       double side2 = getSide();

      

       double hypotanous = getHypotanous(side1, side2);

      

       display(hypotanous);

      

   }

}

/*

Sample run:

Enter side: 4

Enter side: 3

hypotanous: 5.0

*/

 write the class name please. Declarations 2 points 12) The first numbers of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21. 34, 55, 89, 144,... Each n
 write the class name please. Declarations 2 points 12) The first numbers of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21. 34, 55, 89, 144,... Each n
 write the class name please. Declarations 2 points 12) The first numbers of the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21. 34, 55, 89, 144,... Each n

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site