Print out the average score accurate to two decimal places

Assignment Help Python Programming
Reference no: EM13825406

PROGRAM A:

This program should use a main function and another function named makelist as follows:

in main, generate a random integer that is greater than 5 and less than 13.

print this number on its own line.

call the makelist function with the random integer as sole argument.

inside the makelist function:

make an empty list.

use a loop to append to the list a number of elements equal to the random integer argument. All new list elements must be random integers ranging from 1 to 100, inclusive. Duplicates are okay.

return the list to main.

back in main, catch the returned list and sort it.

finally, use a for loop to display the sorted list elements, all on one line, separated by single spaces.

PROGRAM B:

Use the text file named scores.txt (supplied). It contains a number of integer test scores, one per line. Your program should use a main function and another function named showscores as follows:

in main, create an empty list.

open the file named scores.txt.

use a while loop that can detect the end of file to read the scores, and add them to the list.

close the file.

call the showscores function with the list of scores as sole argument.

inside the showscores function:

process the list of scores. NOTE: your instructor will use a modified version of scores.txt with different scores and a different number of scores. Your code should be capable of handling this.

print out the average score accurate to two decimal places.

Reference no: EM13825406

Questions Cloud

Discuss how tirgaran ltd should account for these costs : Discuss how Tirgaran Ltd should account for these costs. Provide journal entries with an explanation of why these are the appropriate entries
Raise money for the event : Every runner is required to solicit sponsors to help raise money for the event. There are two types of sponsors - corporate and personal.Design a second table that will store data about the sponsors for each runner.1.Make a list of the field names an..
File sharing program : Explain what your process was and how the experiment went. Were you successful? What did you learn from the experience ?Experiment choice #1:  File Sharing Program Download a current version a file sharing program such as BitTorrent and use it to dow..
Law of death penalty in the united states : The US Supreme Court has often dealt with the question of whether the death penalty is cruel and unusual punishments, sometimes seeming to hold that it is cruel and unusual punishment and sometimes seeming to hold that particular ways of administe..
Print out the average score accurate to two decimal places : print out the average score accurate to two decimal places.
What type of noncash scheme is baker most likely : Baker is an auditor for ABC Company. As part of a proactive fraud audit (using CAATs), Baker runs the following tests: (1) a review of the sales register for dormant customer accounts that posted a sale within the last two months; Taken together, wha..
How protocols support business processes : Define upper layer applications.Explain how the application layer manages distributed applications and their protocols.Describes the application protocols associated with these services
Discuss the role of an accountant in a business organization : Discuss the role of an accountant in a business organization
Explian about a firm operating monopolistically in a market : The problem belongs to Economics, mainly to Micro-economics and it converse about a firm operating monopolistically in a competitive market ends up with super-normal profit with advertisement.

Reviews

Write a Review

Python Programming Questions & Answers

  Cleint software so that it does not display

Rewrite the cleint software so that it does not display an echo of a message sent by the users. Maybe it means that each time a user tries to send a private message that same message is also sent back to them? summary: stop that from happening?

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Write a program that obtains integer numbers from user

Emphasize standard approaches that verify you have successfully mastered the concepts of structured design - selects a menu item, program should perform calculation, display the result to the user, and return to the main menu.

  Python program that reads in a series of positive integers

Write a Python program that reads in a series of positive integers and writes out theproduct of all the integers less than 25 and the sum of all the integers greater than or equal to 25. Use 0 as a sentinel value

  Tower of hanoi game

Tower of Hanoi game that you can let a player to move discs between the towers using a mouse - Each move consists of taking the upper disk from one of the pegs and sliding it onto another rod, on top of the other disks that may already be present o..

  Write a loop that counts the number of space

Write a loop that counts the number of space characters in a string. Recall that the space character is represented a

  Python journeyman

What are the steps YOU would recommend to a Python journeyman, from apprenticeship to guru status?

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

  Do a python project and get it running using app engine

Do a python project and get it running using App engine. Something very basic and simple

  Recursive sorts are easier to write in functional style

Recursive sorts are easier to write in functional style than others. Two recursive sorts are  Quicksort and Mergesort. Write functional versions of (a) Quicksort; (b) Mergesort in an  imperative language of your choice (e.g., C, Ada, C++, Python), us..

  Write a function that will take two arguments

Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid and write code to read, in turn, each line of the file, remove the newline character and append the resulting string to a list of stri..

  Grade that will calculate and return a student''s exam

Write a function overall Grade that will calculate and return a student's 2316 exam average. It will accept five parameters, which correspond to exam1,2,3,4 and the Final grade. It should replace the lowest exam grade with the 2nd lowest exam grade

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd