CS-521 Homework 4

$30.00

Download Details:

  • Name: CS_521_hw_4-uab9yl.zip
  • Type: zip
  • Size: 240.87 KB

Category:

Description

Rate this product

Complete the following problems from the textbook: 10.1, 10.3, 10.5 (pages 349-350); 11.1, 11.3
(pages 381-383); 14.1 (page 496-497).
*14.1 (Display keywords) Revise Listing 14.4 CountKeywords.py to display the keywords in a Python source file as well as to count the number of the keywords.
*11.3 (Sort students by grades) Rewrite Listing 11.2, GradeExam.py, to display the students in increasing order of the number of correct answers.
Sum of the elements for column 1 is 9.0
Sum of the elements for column 2 is 13.0
Sum of the elements for column 3 is 13.0
Sections 11.2-11.3
*11.1 (Sum elements column by column) Write a function that returns the sum of all the
elements in aspecified column in a matrix using the following header:
def sumColumn(m, columnIndex):
Write a test program that reads a 3 X 4 matrix and displays the sum of each column. Here is a sample run:
Enter a 3-by-4 matrix row for row 0: 1.5 2 3 4
Enter a 3-by-4 matrix row for row 1: 5.5 678
Enter a 3-by-4 matrix row for row 2: 9.5 1 3 1
Sum of the elements for column 0 is 16.5
Enter
Entar
Enter
**10.5 (Print distinct numbers) Write a program that reads in numbers separated by a
space in one line and displays distinct numbers (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read all the numbers and store
them in 1istl. Create a new list 1ist2. Add a number in 11istl to list2.
If the number is already in the list, ignore it.) Here is the sample run of the
program:
Enter ten numbers: 1 23 2 1 6 3 4 52
The distinct numbers are: 1 2 3 6 4 5
Enter
Where to submit?
Click Assignments in the Navigation Area and then click on the title of the assignment to enter the
submission area and upload your response.