Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you run this Java program either in Visual Studio or Netbeans or Eclips and make a screenshot of the invalid output? please attach a

Can you run this Java program either in Visual Studio or Netbeans or Eclips and make a screenshot of the invalid output? please attach a short paragraph of description of why we test the invalid situation of it and how come to the invalid output.

For example, this is the valid input:

image text in transcribed

Here is the code:

import java.util.*; // thread class class X extends Thread{ public void run() { JavaApplication1.arr[0]=0; JavaApplication1.arr[1]=1; // loop til; n times for(int i=2;i JavaApplication1.arr[i]=JavaApplication1.arr[i-1]+JavaApplication1.arr[i- 2];} } }

// driver class public class JavaApplication1 {

// declare a variable n static int n; // a variable of size 100 static int arr[]=new int[100]; public static void main(String args[]) { // fibonacci sequence System.out.println("enter the number of fibbonacci series length :"); // take the input Scanner sc=new Scanner(System.in); String str=sc.nextLine(); // take n as the input n=Integer.parseInt(str); // declare a thread X thread1=new X();

// start the thread thread1.start();

// run the thread try{ thread1.join(); } catch(Exception e) { }

// print the fibonacci numbers System.out.println("the fibbonacci series numbers are"); for(int i=0;i System.out.println(arr[i]);

} }

public class test5 f static int n static int arr[]=new int [100]; e ublic static void main (String args[) System.out.println ("enter the number of fibbonacci series length ") scanner sc=new Scanner (System.in); String str=sc.nextline(); n-Integer.parseInt (str): EL Problems @JavadocDeclaration.Console X sterminated> test5 [Java Application] CProgram Files Java jre8bin javaw.exe (Sep 29, 2013 3:58:09 PM enter the number of fibbonacci series length 7 the fibbonacci series numbers are: 1 1 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

=+5.14. Let f (x) be n2x or 2n -n2x or 0 according as 0 5x

Answered: 1 week ago

Question

Prepare and properly label figures and tables for written reports.

Answered: 1 week ago