ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 9.00

Create a function called allButMax

I know you already answered this question for me, but my teacher emailed me saying I need to not use min, max or sum because we haven't learned these yet; he wants us to just use loops 

PLEASE HELP HW DUE TOMORROW 

How can I redo this problem

Create a function called allButMax that expects no arguments. Instead, this function gets its input from the user at the keyboard. The function asks the user to enter a series of numbers greater than or equal to zero, one at a time. The user types end to indicate that there are no more numbers. The function computes the sum of all the values entered except for the maximum value in the series. (Think of this as dropping the highest homework score from a series of homework scores.) The function then both prints the sum and returns the sum. You may assume the user inputs are valid: they will either be a number greater than or equal to zero, or the string end. Here are some examples of how your function should behave:

>>> allButMax()

Enter next number: 20

Enter next number: 30

Enter next number: 40

Enter next number: end

The sum of all values except for the maximum value is: 50

 

>>> allButMax()

Enter next number: 1.55

Enter next number: 90

Enter next number: 8.45

Enter next number: 2

Enter next number: end

The sum of all values except for the maximum value is: 12

 

>>> x = allButMax()

Enter next number: 3

Enter next number: 2

Enter next number: 1

Enter next number: end

The sum of all values except for the maximum value is: 3.0

>>> print(x)3.0

Answers

(11)
Status NEW Posted 11 May 2017 02:05 AM My Price 9.00

-----------

Not Rated(0)