Website Pagination There will be a list of items in the form of a 2- dimensional string array where each element contains [name, relevance, price). Given the sort column, the sort order (O: ascending,...

1 answer below »
Website Pagination There will be a list of items in the form of a 2- dimensional string array where each element contains [name, relevance, price). Given the sort column, the sort order (O: ascending, 1: descending), the number of items to be displayed on each page (except for the last page which may have fewer), and a page number, determine the list of item names in the specified page while respecting the item's order. Page numbering starts at 0. Example items = [[item1, 10, 151, l'item2! 3/ 43. [items '17, '8] sortParameter = 1 sortOrder = 0 itemsPerPage = 2 pageNumber=1 • n = 3 items • Sort them by (relevance: 1) in ascending order items [l'item2, 3, 43. [item: '70'15%. ['item3', '17', '8']) • Display up to 2 items in each page • The page contains 2 item names [item2'item1'] and page 1 contains only 1 item name, so result = item whackerrank.com/test/eoip45dca58/questions/6716fkknish Function Description Complete the function fetchitemsToDisplay in the editor below. fetchItemsToDisplay has the following parameter(s); string items(n][3). a 2D array of arrays of strings in the form (name, relevance, price] int sortParameters the column of the items to sort on int sortOrder:0 = ascending and 1 = descending int itemsPerPage: the number of items per page int pageNumber the page number to display item names Returns: string pageltems[m]: array of item names on the requested page in the order they are displayed Constraints • 1sn #!/bin/python3... # 2 3 1 5 7 3 # Complete the 'fetchItemsToDisplay' function below. # # The function is expected to return a STRING_ARRAY. # The function accepts following parameters: 1. 2D_STRING_ARRAY items 2. INTEGER sortParameter # 3. INTEGER sortOrder 4. INTEGER itemsPerPage 5. INTEGER pageNumber # # 3 def fetchItemsToDisplay (items, sortParameter, sortorder, itemsPerPage, pageNumber): # Write your code here 5 name _main.:
Answered 235 days AfterNov 30, 2021

Answer To: Website Pagination There will be a list of items in the form of a 2- dimensional string array where...

Aditi answered on Jul 23 2022
90 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here