My problem is this: obviously i can follow directions and learn. However, I am having trouble developing the thinking development part or thinking in Java. Granted, this is my first computer science class but I'm getting discouraged and falling behind in my class. I want to learn how to write java not just take your perfectly written programs and hand them in as my own although that would get me an A, lol.
So far i have
// i'm attempting to say i want my array to be called tennumbs and have a column size of 10.
int[] tennumbs = new int [10];
//I have no idea what the next following line really means but i found in my book that it needed to be added. Im trying to declare my variable.
for (int i = 0; i < data.length; I++);
is this right so far and how do i prompt for input values? by using java.util.scanner?
heres the requirements for the program.
Working with single dimension arrays.
Write a program that reads positive numbers (integers) and stores them into an array.
1.Write a method to prompt for the input values. (sentinel terminated)
2.Write a method to print the array.
3.Write a method that returns the value of the smallest number.
4.Write a method that returns the value of the largest number.
5.Write a method to find the location of a number (array index + 1) .
6.Write a method to compute the average of the numbers in the array.
7.Write a method to output the results.
The input prompt example
Enter at least unique 10 positive numbers (integers) terminated with a sentinel value (-99)
The output could look like this:
Amount of numbers read: 10
Numbers read: 12, 33, 41, 1, 4, 10, 7, 21, 66, 50
Smallest number was 1 in location 4
Largest number was 66 in location 9
Average was 24.5