Design a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. For example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two.
Need Variable lists, Psuedocode, ipo chart, Flow Chart, and a python code.
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program:
calcAverage—This function should accept five test scores as arguments and return the average of the scores.
determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale:
| Score | Letter Grade |
|---|---|
| 90–100 | A |
| 80–89 | B |
| 70–79 | C |
| 60–69 | D |
| Below 60 |
F Need Variable lists, Psuedocode, ipo chart, Flow Chart, and a python code. |
MAximum of two numbers :
def max( firstNumber , secondNumber ): //function max crated
with two argument
if firstNumber > secondNumber:
return firstNumber
else:
return secondNumber
def getNumbersFromUser(): //getNumbersFromUser created for
taking input from user
userFirstNumber = int( input( "Please enter 1 numbr" ) )
userSecondNumber = int( input( "Please enter 2 numbr" ) )
return userFirstNumber, userSecondNumber
def main():
userFirstNumber, userSecondNumber = getNumbersFromUser()
print( " Maximum : ", max(userFirstNumber, userSecondNumber )
)
main()
2. average
def calcAverage( s1, s2, s3, s4, s5 ):
average = ( s1 + s2 + s3 + s4 + s5 ) / 5
return average
def determingrade( userscore ):
if( userscore < 60 ):
return "F"
elif( userscore < 70 ):
return "D"
elif( userscore < 80 ):
return "C"
elif( userscore < 90 ):
return "B"
elif( userscore < 101 ):
return "A"
def askscore():
s1 = float( input( "Enter s1 " ) )
s2 = float( input( "Enter s2 " ) )
s3 = float( input( "Enter s3 " ) )
s4 = float( input( "Enter s4 " ) )
s5 = float( input( "Enter s5 " ) )
return s1, s2, s3, s4, s5
def printresult( s1, s2, s3, s4, s5 ):
print( " score \t\t Grade" )
print( str( s1 ) + "\t\t\n" + determingrade( s1 ), str( s2 ) + "\t\t\n" + determingrade( s2 ), str( s3 ) + "\t\t\n" + determingrade( s3 ),str( s4 ) + "\t\t\n" + determingrade( s4 ),str( s5 ) + "\t\t\n" + determingrade( s5 ) )
def main():
s1, s2, s3, s4, s5 = askscore()
printresult( s1, s2, s3, s4, s5 )
main()
Pseudocode :-
1)start the program
2) get the both the inputs X and Y
3)Check whether both are same or not
4)
Design a function named max that accepts two integer values as arguments and returns the value...
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...
design a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. for example if 7 and 12 are passed as arguments to the function the function should return 12. use the function in a program that prompts the user to enter two integer values. the program should display the value that is the greater of the two.
Write a javascript program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program: calcAverage—This method should accept five test scores as arguments and return the average of the scores. determineGrade—This method should accept a test score as an argument and return a letter grade for the score,
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Round the average...
I am supposed to a pseudocode function named max that accepts two integer values as arguments and returns the value that is greater of the two. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is greater of the two. Is everything correct and complete? //Pseudocode //This function takes two integers as parameters: x and y Begin : Max(x,y) If(x>y) then MAX=x Else MAX=y End if Return...
Solve This Problem using python and please comment on every
line. also, use function to solve this.
thanks
The result will be like as below:
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program: This function should accept five test scores as arguments and return the average of the scores. This function should accept a...
PYTHON QUESTION PLEASE!!
Write a function named problem3 that accepts two strings as the
arguments, returns the characters that occur in both strings. Test
case: the arguments are “apple@123” and “banana@#345”, your program
should return “a@3”.
Write a function named problem3 that accepts two strings as the arguments, returns the characters that occur in both strings. (20 pts) Test case: the arguments are "apple@123” and “banana@#345”, your program should return "a@3".
Python problem
QUESTION 48 Write a function named was that accepts two integer values as arquments and returns the wake that is greater of the two for example, if 7 and 12 are passed as arguments the function should return 12. If the arguments are equal the function should return zero. TTTA 3112) T V 2
PYTHON: Using Lists and Arrays! 5. In a program, write a function that accepts two arguments: a list, and a number n. The program should generate 20 random numbers, in the range of 1 through 100, and assign each number to the list. The program should also ask the user to pick a number from 1 through a 100 and assign that number to n. The function should display all of the number in the list that are greater than...
Total Sales Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Need: variable lists, IPO Chart, pseudocode, Flowchart, and working Python code. 2. Lottery Number Generator Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop...