Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Lab11
- {
- public static void main(String[] args)
- {
- Scanner keyboard = new Scanner(System.in);
- double[] y = new double[1000];
- for(int i = 0; i < y.length; i++)
- {
- y[i] = i * 7.5;
- }
- for(int i = 0; i < y.length; i++)
- {
- System.out.println("Enter an array slot number:");
- i = keyboard.nextInt();
- dif(i < y.length)
- {
- System.out.println("The value in array slot " + i + " is " + y[i]);
- }
- else
- {
- System.out.println("Value out of range.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement