Search

Custom Search

Saturday, November 20, 2010

computer science assignment

(Must be implemented using a one-dimensional array.)

Write an application that inputs ten numbers from the user, each number can be between 10 and 100, inclusive. As each number is read in determine if it is a number already entered. If it is a duplicate move on to the next number, if it is unique store the number in the array. After all ten numbers have been entered display the complete set of unique numbers that were entered. Submit your zipped NetBeans with all files, essay, and screenshots demonstrating your code runs. Your essay should discuss any challenges you encountered including compilation errors, logic errors, or runtime errors you had to resolve.

You will be graded according to the following grade breakdown structure:

Here’s the instructor’s guide…



for loop // loop 10 times

{

    do

    {  

          //Get number input

          //If the number is not between 10 and 100, prompt to try again

    } while ( ... );



    for loop //loop through the current numbers in the array

    {

        //check to see if the current number is a duplicate

        //use a boolean variable to keep track of if the value is unique

    }



    if ( ... )   //if the number was determined to be unique

    {

        //store it in the next available position in the array

        //update counter variable to keep track of number of array elements

    }

}



for loop //loop for the number of unique values (not necessarily 10)!

{

    //Display each unique value

}

No comments:

Post a Comment