answer.
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
kvasek [131]
1 year ago
15

Write a statement that assigns finalResult with the sum of num1 and num2, divided by 3. Ex: If num1 is 4 and num2 is 5, finalRes

ult is 3.
Computers and Technology
1 answer:
olganol [36]1 year ago
6 0

Answer:

Written using Python 3:

<em>num1 = int(input("Enter first value: ")) </em>

<em>num2 = int(input("Enter second value: ")) </em>

<em> </em>

<em>finalResult =(num1+num2) / 3 </em>

<em>print("Answer is: ", finalResult)</em>

<em />

INPUT:

Enter first value: 4

Enter second value: 5

OUTPUT:

Answer is: 3

Explanation:

First step is to declare the variables:

  • num1 and num2

Second is to ask for an input:

  • input("Enter first value: ")

Then we need to convert them into integers by encapsulating the line above inside int(). This is a requirement before you can do any mathematical operations with the given values.

  • num1 = int(input("Enter first value: "))

Next is to calculate:

  • <em>finalResult </em><em>=(num1+num2) / 3 </em>
  • Here we first add the values of num1 and num2, <em>then </em>divide the sum by 3.

And to test if the output is correct, let us print it:

  • <em>print("Answer is: "</em><em>,</em><em> </em><em>finalResult</em><em>)</em>
  • print() - when used for strings/texts, use quotation marks like: "text here"
  • but when used to print variables and numbers (integers, floats, etc), there is no need to enclose them with quotation marks.
  • to concatenate string and an integer (in this case the variable finalResult), simply add a comma right after the string.

<em />

You might be interested in
At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase
inn [45]

Answer:

#include <iostream>

using namespace std;

 

int main () {

  // for loop execution

  int semester_fees=8000;

  int b=1;

  cout<<"there are 5 years or 10 semester fees breakdown is given below"<<endl;

  for( int a = 1; a <=5; a++ ) {

     semester_fees = semester_fees*1.03;

     cout<<"Semester fees for each of semester"<<b++<<"and"<<b++<<"is:$"<<semester_fees<<endl;

     

  }

 

  return 0;

}

Explanation:

code is in c++ language

Fees is incremented yearly and i have considered only two semester per year

3 0
1 year ago
Write a function called sum_scores. It should take four arguments, where each argument is the team's score for that quarter. It
saw5 [17]

Answer:

Here is the Python program which has a function sum_scores:

def sum_scores(score1, score2, score3, score4):

   sum = score1 + score2 + score3 + score4

   print(sum)    

sum_scores(14,7,3,0)

Explanation:

  • Method sum_scores takes four arguments, score1, score2, score3, score4.
  • The sum variable adds these four scores and stores the value of their addition.
  • Lastly print statement is used to print the value stored in sum variable which is the value obtained by adding the four scores.
  • Last statement calls the sum_scores method and passes four values to it which are 14,7,3,0
  • The output of the above program is:
  • 24
  • If you want to use return statement instead of print statement you can replace print(sum) with return sum. But in order to display the sum of the scores you can replace sum_scores(14,7,3,0) with print(sum_scores(14,7,3,0))
  • The program along with the output is attached as a screenshot.

5 0
2 years ago
# 1) Complete the function to return the result of the conversion
seraphim [82]

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)  <em>        return km</em>

 

return km returns the result of the computation

2)  = <em>convert_distance(my_trip_miles)</em>

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + <em>str(my_trip_km)</em>

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

3 0
1 year ago
Suppose a computer has 16-bit instructions. The instruction set consists of 32 different operations. All instructions have an op
Kazeer [188]

Answer:

2^7= 128

Explanation:

An instruction format characterizes the diverse part of a guidance. The fundamental segments of an instruction are opcode and operands. Here are the various terms identified with guidance design:  Instruction set size tells the absolute number of guidelines characterized in the processor.  Opcode size is the quantity of bits involved by the opcode which is determined by taking log of guidance set size.  Operand size is the quantity of bits involved by the operand.  Guidance size is determined as total of bits involved by opcode and operands.

6 0
2 years ago
The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
Andrej [43]

Answer:

The best option is A).True

Explanation:

This is because, according to the statement, it is possible to uncover a potential threat in the risk governance domain and quickly assess its impact using the risk evaluation domain in an IT environment. The risk IT framework is used in an IT environment for security of domains, the business involved, etc.

6 0
2 years ago
Other questions:
  • john wants to view sarah's assignment files on his computer. but he cannot open them because of version problems. which upgrade
    14·2 answers
  • Which element of the word program window contains buttons for saving a document and for undoing, redoing, and repeating a change
    5·1 answer
  • Allows you to manually add an entry to the arp cache that resolves the ip address inetaddr to the physical address etheraddr. wh
    13·1 answer
  • This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
    6·2 answers
  • "online privacy alliance (opa) is an organization of companies dedicated to protecting online privacy. members of opa agree to c
    15·1 answer
  • Given an alphabet, print all the alphabets up to and including the given alphabet.
    15·2 answers
  • Assign test_stat_72 to the value of the test statistic for the years 1971 to 1973 using the states in death_penalty_murder_rates
    11·1 answer
  • Which of the following can you NOT apply for at any FLHSMV office? A. Certificate of title B. License plates C. Vehicle registra
    15·2 answers
  • Ana works in the medical records department at a large medical office. Her job includes scanning and uploading medical records i
    15·1 answer
  • 1.the following code example would print the data type of x, what data type would that be?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!