1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anna35 [415]
4 years ago
13

Your school is hosting a diving contest, and they need a programmer to work on the scoreboard! Your job is to calculate each div

er's total after the three judges hold up their individual scores. Write the function calculate_score which takes a tuple of three numbers from 0 to 10 and calculates the sum. A perfect dive is worth 30 points, a belly flop is worth 0. For example: calculate_score((10, 10, 10)) # => 30 calculate_score((9, 9, 6)) # => 24
Computers and Technology
1 answer:
prohojiy [21]4 years ago
3 0

Answer:

def calculate_score(setss):

    num1, num2, num3= setss

    if num1 >= 0 and num1 <=10 and num2>= 0 and num2<=10 and num3>= 0 and num3<=10:

         print(num1+ num2+num3)

    else:

         print("Out of range")

Explanation:

<em>I've added the full source code as an attachment, where I used comments as explanation</em>

Download txt
You might be interested in
408 request timeout your browser didn't send a complete request in time
Alik [6]
<span>408 Request Time out error messages are often customized by every website. These messages are especially for large websites that take long time to process itself.
</span>
<span /><span>Causes for these messages:
The 408 Request Timeout error is an HTTP status code that says that your request is not send to the server in the given time. In other words, your website connection is “timed out”
</span>


6 0
4 years ago
Frankie used the ps command to find the process id of an application that he needs to stop. What command-line tool should he use
ASHA 777 [7]

In the case above, the command-line tool should he use to stop the application based on its process id is e option

What is the use of ps command?

The ps command is known to be one that helps enables a person to be able to look at the status of any kind of active processes on a system, and also that of display technical information in regards to the processes.

Note that In the case above, the command-line tool should he use to stop the application based on its process id is e option

Learn more about command-line tool from

brainly.com/question/3737699

#SPJ1

7 0
2 years ago
When implementing a physical database from a logical data model, you must consider database performance by allowing data in the
Galina-37 [17]

Answer:

A method  used to improve the performance of structure when running queries is known as Partitioning indexes.

The advantages of partitioning indexes are, It enables data management operations for example,  index creation and rebuilding, It increases query performance.

The disadvantages are, one cannot define the primary index of partitioned table to be unique unless the whole partitioning column set is part of the primary index definition.

Explanation:

Solution

Partitioning indexes are known as b -tress indexes that shows hon how to break up the index into separate or different partitions.

Partitioning is usually done to enhance the performance and increased availability. when data are spread over  multiple partitions, one can be able to operate on one partition  without affecting others. i.e to run utilities, or to take data offline.

Almost all DBMS products support partitioning, but in various ways. we must be sure to know the nuances of an individual a particular DBMS execution before partitioning.

The advantages of Partitioned indexes are as follows:

It enables data management operations for example,  index creation and rebuilding

It increases  performance of query

It can significantly the impact of schedule downtime for maintenance operations

Disadvantages:

The primary index of partitioned table cannot be described to be unique except if  the whole partitioning column set is part of the primary index definition.

5 0
4 years ago
Should spreadsheets be used to keep score of a baseball game?<br><br> YES<br> NO
AysviL [449]
Yes, a spreadsheet can do the maths for you
4 0
2 years ago
write a JAVA program that has the following methods. a. int firstDigit(int n) , returning the first digit of the argument b. int
ladessa [460]

Answer:

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        System.out.println(firstDigit(1729));
  4.        System.out.println(lastDigit(1729));
  5.        System.out.println(digits(1729));
  6.    }
  7.    public static int firstDigit(int n){
  8.        String n_str = Integer.toString(n);
  9.        char firstChar = n_str.charAt(0);
  10.        String firstDigit = Character.toString(firstChar);
  11.        return Integer.parseInt(firstDigit);
  12.    }
  13.    public static int lastDigit(int n){
  14.        String n_str = Integer.toString(n);
  15.        char lastChar = n_str.charAt(n_str.length() - 1);
  16.        String lastDigit = Character.toString(lastChar);
  17.        return Integer.parseInt(lastDigit);
  18.    }
  19.    public static int digits(int n){
  20.        String n_str = Integer.toString(n);
  21.        return n_str.length();
  22.    }
  23. }

Explanation:

Firstly we create a method firstDigit that will return the first digit of the input number (Line 8 - 13). This method will convert the input number, n, to string using Integer toString method (Line 9) and assign it to n_stry variable. Next, use charAt method with 0 index to get the first character from n_str and assign it to firstChar variable (Line 10). Next, use Character toString method to convert the firstChar to string type (Line 11) because the parseInt method which is used in Line 12 will only work on String type but not char type. The function return the firstDigit with integer type (Line 12). The parseInt method has converted the string type firstDigit to integer.

The logical steps defined for lastDigit method are similar to firstDigit except that we need to use .length() method to get the length of the digit string and calculate the last index to get the last digit (Line 17).

The digits method (Line 22 -25) will convert the input number to string and then use .length() method to return the length of the number string which is equivalent of number of digit as output.  

7 0
4 years ago
Other questions:
  • Why are some constraints automatically applied by the software
    9·1 answer
  • In an image citation, what piece of information is listed first?
    14·1 answer
  • Write a program that reads a target string from the keyboard and then another sentence string from the keyboard.
    10·1 answer
  • Servlet session and JSP session have differentabilities.<br>? True<br><br>? False
    15·1 answer
  • Malware that is spread through security warnings or advertisements for antivirus software is known as
    5·1 answer
  • Your company shares a building with a competitor's branch office. Recently, you noticed that some computers other than company c
    14·1 answer
  • Eliza needs to share contact information with another user, but she wants to include only certain information in the contact. Wh
    7·1 answer
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    14·2 answers
  • What does the sign (#) mean in manuscript edpm<br> and also what does (DEL)
    15·1 answer
  • Why must the image be reduced when the field of view is widened to take in more of the scene?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!