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
olganol [36]
3 years ago
8

Write a script which: Uses the input function to get any number and store it in a variable named my_number Create a new variable

named calculation which equals my_number plus 9 Multiply calculation by 2 Subtract 4 from calculation Divide calculation by 2 Subtract my_number from calculation Print calculation
Computers and Technology
1 answer:
WINSTONCH [101]3 years ago
7 0
<h3><u>Answer:</u></h3>

# Using the input function

# Prompt the user to input some number

# Convert the input to a float - this will cater for both floating

# numbers and integers

# Store the result in a variable called my_number

my_number = float(input('Please enter some number '))

#Create a variable named calculation which equals my_number plus 9

calculation = my_number + 9

#Multiply calculation by 2

calculation *= 2

#Subtract 4 from calculation

calculation -= 4

#Divide calculation by 2

calculation /= 2

#Subtract my_number from calculation

calculation -= my_number

#Print calculation

print('calculation = ' + str(calculation))

<h2><u>Sample Output</u></h2>

>> Please enter some number 8

calculation = 7.0

<h2><u>Explanation:</u></h2>

The above program has been written in Python and it contains comments explaining each line of the code. Please go through the comments. A sample output has also been provided.

You might be interested in
You are in the process of replacing the toner cartrige for a laser printer. however, you notice that toner particles have been s
makkiz [27]

Answer:

Toner vacuum

Explanation:

In the process of replacing the toner cartrige for a laser printer, whenever you notice that toner particles have been split inside the printer, what you should use to effectively remove these particles is a TONER VACUUM, it is a device specially created for that purpose, after using a toner vacuum, you can use the activated toner clothe to clean the rest, after which I will advise you to use an aerosol spry to get the best result.

8 0
3 years ago
Which process passes private and sensitive information to unscrupulous websites through clicks on random links?
QveST [7]

Answer is Phishing

Phishing is fraudulent and it attempts to steal your personal information through unscrupulous websites. A phishing website tries to steal private and sensitive information by tricking the user into believing that he/she is on legitimate website. You could easily land into a phishing website by mistyping a web address. It mainly comes through malicious links attached to an email, IM, or text messages. Do not be duped or fall victim to such links.

6 0
3 years ago
Read 2 more answers
Since helium has an atomic number of 2 and an weight of 4, we know it must contain ____ nuetrons
BabaBlast [244]
The answer is : C. 2 Neutrons
7 0
3 years ago
Melissa has moved to a new country after getting married. She has realized that the cuisine of her husband’s homeland is very di
iogann1982 [59]

It sounds a lot like the United States.

7 0
3 years ago
Read 2 more answers
6.2 Sum the digits in an integer (Sum the digits in an integer) Write a method that computes the sum of the digits in an integer
liberstina [14]

Answer:

The method sumDigits() and the test program is given in the explanation section below:

Explanation:

import java.util.Scanner;

public class num8 {

   public static int sumDigits(long n){

       long sum = 0;

       while (n != 0)

       {

           sum = sum + n % 10;

           n = n/10;

       }

       return (int)sum;

   }

   public static void main(String[] args) {

       System.out.println("Enter a long integer");

       Scanner in = new Scanner(System.in);

       long digit = in.nextLong();

       System.out.println(sumDigits(digit));

   }

}

The steps required to implement this method are given in the question. A while is used to repeatedly extract and remove the digit until all the digits are extracted. In the main method, the Scanner class is used to prompt a user to enter a digit, the method is called and the digit is passed as an argument.

4 0
3 years ago
Other questions:
  • 3. If B3=6 and D5=8, what would the following function return? IF(B3&gt;D5, "Closed", D5-B3) *
    10·2 answers
  • Create a class named BaseballGame that contains data fields for two team names and scores for each team in each of nine innings.
    12·1 answer
  • ____________________ memory is the ability to add RAM without shutting down the computer or operating system.
    13·1 answer
  • Rony works on several confidential files for his company. Ignoring the privacy requirements, Rony places the files in a shared f
    7·1 answer
  • _____ is a secret or illegal cooperation or conspiracy, especially in order to cheat or deceive others.A.CollusionB.Business eth
    12·1 answer
  • To print a range of cells in the active worksheet, click ____ in the settings area in the print gallery.
    14·1 answer
  • To add a new kind of information into the database you need to add a new table<br> true or false?
    7·2 answers
  • "Why learning how to type is so important.
    7·1 answer
  • If the tax percent is 15% and tax is $36 and percent discount is 10, what is the cost price?​
    12·1 answer
  • B) The company's chief financial officer recognizes the need for an upgrade to the smart watches, but does not understand why th
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!