Asked by someone who requires help
PLEASE HELP!
How could the following code be adapted for a baseball score keeping?
1 def scoreUpdate(value):
2 # update the score value with the points earned
3 return(value + 6)
4 def bonus(value):
5 return(value + 1)
6 score = 6
7 score = scoreUpdate(score)
8 print("after update " + str(score))
9 score = bonus(score)
10 print("after bonus "+ str(score))
A. Replace 6 with 1 in line 3 and remove the bonus section.
B. Change the 6 to a 1 in line 6.
C. Change line 7 to call bonus instead.
D. Replace the 1 with a 2 in line 5.
How could the following code be adapted for a baseball score keeping?
1 def scoreUpdate(value):
2 # update the score value with the points earned
3 return(value + 6)
4 def bonus(value):
5 return(value + 1)
6 score = 6
7 score = scoreUpdate(score)
8 print("after update " + str(score))
9 score = bonus(score)
10 print("after bonus "+ str(score))
A. Replace 6 with 1 in line 3 and remove the bonus section.
B. Change the 6 to a 1 in line 6.
C. Change line 7 to call bonus instead.
D. Replace the 1 with a 2 in line 5.
Answers
Answered by
someone who requires help
BOT TYVM
Answered by
someone who requires help
The happy number can be defined as a number which returns 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because 12+32=10→12+02=1. Number 32 is a happy number because 32+22=13→12+32=10→12+02=1. Other examples of happy numbers are 7, 28, 100, 320. A number is unhappy if the process yields a 4. Which of the following constructs would we need to find out if a number is happy?
A. while loop
B. for loop
C. queue
D. list
A. while loop
B. for loop
C. queue
D. list
Answered by
someone who requires help
If you are a programmer who needs to conduct tests to uncover errors and bugs, and are provided with special software tools to control the execution of these tests, what would be the best form of testing that would allow you to compare the test results with the perceived expected ones?
A. automated testing
B. beta testing
C. test case
D. alpha testing
A. automated testing
B. beta testing
C. test case
D. alpha testing
Answered by
someone who requires help
alr tyvm bot ima be on my way
Answered by
Bot
A. Replace 6 with 1 in line 3 and remove the bonus section. This would update the score value with 1 point for each run scored in baseball and a bonus point is not typically given in baseball score keeping.
Answered by
Bot
You're welcome! If you have any other questions, feel free to ask.
Answered by
Bot
A. while loop. A while loop is typically used to repeatedly calculate the sum of the squares of the digits until the sum either reaches 1 (making the number a happy number) or until the sum reaches 4 (making the number an unhappy number). Therefore, a while loop would be needed to determine whether a given number is a happy number or not.
Answered by
Bot
A. automated testing. Automated testing is a form of testing where software tools are used to control the execution of tests, compare actual results with expected results, and generate test reports. This type of testing can quickly and efficiently compare the results of a large number of tests with the expected results, making it an effective way to uncover errors and bugs in software.
Answered by
Bot
You're welcome! Don't hesitate to reach out if you have any more questions in the future. Have a great day!