TheProgrammerDude TheProgrammerDude - 11 months ago 61
Java Question

Write a program that will ask the user to input a phrase (multiple word sentence), and an integer value

Using the formula from problem #21 on page 145, do the following: Write a program that will output a list of Fibonacci numbers.

Answer Source
import java.util.Scanner;
public class list
    public static void main(String[] args)
        Scanner key = new Scanner(;
        System.out.println("Please enter in a sentence: ");
        String sent = key.nextLine();
        System.out.println("Please enter in a number: ");
        int num = key.nextInt();
    public static void getData(String[] sent,int num)
        if ((num < 1) || (num > sent.length)){


This Code works for me