.

Saturday, April 6, 2019

Search and sort Essay Example for Free

Search and behavior EssayDirection Provide the confiscate out set apart for the pursuance machine problems. Note To authenticate the output, divert insert the printscreen and the source code in a zip file. Deadline of submission September 18, 2013 (no extension).1. Write a program to test the regularity binarySearch. Use either the regularity insertionSort or selectionSort to sort the list originally the search.2. Suppose that the elements of a list are in desc wind uping order and they need to be put in ascending order. Write a Java method that takes as input an array of items in descending order and the turning of elements in the array. The method rearranges the element of the array in ascending order. Your method must not incorporate any sorting algorithms, that is, no item comparisons should occur.3. Write a method, channelize that takes three parameters an array of integers, the length of the array, and an integer, say, removeItem. The method should find and delet e the first occurrence of removeItem in the array. If the cling to does not exist or the array is empty, output an appropriate message. (Note that after deleting the element, the array size is lessen by 1.) You may as stube that the array is unsorted.4. Write a method, removeAt, that takes three parameters an array of integers, the length of the array, and an integer, say, index. The method deletes the array element indicated by index. If index is out of range or the array is empty, output an appropriate message. (Note that after deleting the element, the array size is reduced by 1.) You may assume that the array is unsorted.5. Write a program to keep track of a hardware stores inventory. The store sells versatile items. For each(prenominal) item in the store, the following in haomaation is kept item ID, item name, number of pieces ordered, number of pieces before long in the store, number of pieces sold, manufacturers price of the item, and the stores selling price. At the end of each week, the storemanager would like to see a report in the following formFriendly Hardware StoreitemID itemName pOrdered pInStore pSold manufPrice sellingPrice 4444 Circular Saw 150 150 40 45.00 125.003333 Cooking persona 50 50 20 450.00 850.00...Total Inventory PHP .Total number of items in the store _______The complete inventory is the total selling value of all the items currently in the store. The total number of items is the sum of the number of pieces of all the items in the store. Your program must be menu driven, giving the user various choices, such as check whether an item is in the store, sell an item, and print the report. After inputting the data, sort it tally to the items names. Also, after an item is sold, update the appropriate counts. Initially, the number of pieces (of an item) in the store is the same as the number of pieces ordered, and the number of pieces of an item sold is zero. Input to the program is a file consisting of data in the following form itemIDitemNamepOrdered manufPrice sellingPriceUse seven parallel vectors to store the information. The program must contain at least the following methodsa method to input the data into the vectors, a method to display the menu, a method to sell an item, and a method to print the report for the manager. After inputting the data, sort it according to the items names.

No comments:

Post a Comment