{"id":108162,"date":"2022-12-05T03:45:42","date_gmt":"2022-12-05T03:45:42","guid":{"rendered":"https:\/\/assignmenttutors.net\/blog\/please-create-these-two-programs\/"},"modified":"2022-12-05T03:45:42","modified_gmt":"2022-12-05T03:45:42","slug":"please-create-these-two-programs","status":"publish","type":"post","link":"https:\/\/assignmenttutors.net\/blog\/please-create-these-two-programs\/","title":{"rendered":"Please create these two programs."},"content":{"rendered":"<div>\n<p>\u00a0\u00a0<\/p>\n<p>Please create these two programs.<br \/>Write a program as follows. Follow instructions carefully to avoid point deductions. All statements should be in the main function:<br \/>create an empty list named nums.<br \/>use a loop to add 20 random integers, all in the range from 1-100, to nums.<br \/>print the total of all list elements.<br \/>print the highest number in the list.<br \/>print the lowest number in the list.<br \/>sort the list and then reverse it.<br \/>use another loop to display the sorted numbers in descending order, all on the same line, separated by a single space.<br \/>determine if 75 is in the list. If it is, report the index of its first occurrence. If it is absent from the list, indicate that, too.<br \/>make a new list named middle_10 by slicing out the middle 10 elements of the descending list. Use a loop to display the elements in middle_10 all on one line.<br \/>make an empty list named evens and another empty list named odds.<br \/>use a loop to process nums, adding even elements and odd elements to their respective lists.<br \/>print both evens and odds. Crude dumps inside [ ] as shown next are okay.<br \/>Sample Output 1<br \/>List total: 712<br \/>Highest number: 85<br \/>Lowest number: 2<br \/>All list elements in descending order<br \/>85 83 67 67 58 53 50 49 30 28 23 21 20 20 16 15 14 8 3 2<br \/>75 not in the list<br \/>Middle 10 after descending sort: 53 50 49 30 28 23 21 20 20 16<br \/>Even #s [58, 50, 30, 28, 20, 20, 16, 14, 8, 2]<br \/>Odd #s [85, 83, 67, 67, 53, 49, 23, 21, 15, 3]<br \/>Sample Output 2<br \/>List total: 1000<br \/>Highest number: 99<br \/>Lowest number: 2<br \/>All list elements in descending order<br \/>99 98 87 85 78 75 72 71 54 48 47 35 31 29 25 20 18 16 10 2<br \/>First found 75 at index 5<br \/>Middle 10 after descending sort: 75 72 71 54 48 47 35 31 29 25<br \/>Even #s [98, 78, 72, 54, 48, 20, 18, 16, 10, 2]<br \/>Odd #s [99, 87, 85, 75, 71, 47, 35, 31, 29, 25]<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0\u00a0 Please create these two programs.Write a program as follows. Follow instructions carefully to avoid point deductions. All statements should be in the main function:create an empty list named nums.use a loop to add 20 random integers, all in the range from 1-100, to nums.print the total of all list elements.print the highest number in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-108162","post","type-post","status-publish","format-standard","hentry","category-education"],"_links":{"self":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/108162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/comments?post=108162"}],"version-history":[{"count":0,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/108162\/revisions"}],"wp:attachment":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/media?parent=108162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/categories?post=108162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/tags?post=108162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}