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
disa [49]
3 years ago
15

Why might a variable used for output have to be of a different type then a variable used for input?​

Computers and Technology
1 answer:
telo118 [61]3 years ago
7 0

Answer:

You may use a different variable type for input in order to process the data appropriately and may use a different variable type to accommodate your program.

Explanation:

Your input may have to be different then output varying on what data you are processing.

For example, just like the last question you asked about calculating the area of the rectangle, your input MUST be converted to a different a numerical data type (i.e int or float) in order to do the math.

Based on your last question, if we didn't convert your input into a string your results wouldn't add the numbers together but only concatenate them. If I typed 3 & 5 as length & width, I would get 35 instead of 15.

Now another example is using functions (or methods whatever you want to call them), your input can be one thing and outputs another.

Let's say I want a function to tell me if I am smart. The way I want it to determine if its smart is by inputting my GPA into it, which is a numerical value. So the function would look something like this:

<u>Code (Python)</u>

def IsSmart(gpa):

  if (gpa >= 4):

       return True

  else

       return False

As you can see I am inputting a numerical value and it is outputting a boolean value. I can use this in a if else chain to spit out an output to the user.

You might be interested in
Your company has purchased another company that also uses Windows Server 2016 and Active Directory. Both companies need to be ab
Scorpion4ik [409]

Answer:

Create a two-way forest trust

Explanation:

The aim here is to ensure that both companies are able to access the forest resources of each other. The creation of a Two-way Forest Trust would guarantee that as if the Two-way Forest Trust is created between Forest A and Forest B, being the forest resources of the two companies respectively, then all the domains in Forest A will trust every domain in Forest B and vice versa.

5 0
3 years ago
How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
Umnica [9.8K]
Double click would be enough
6 0
2 years ago
Read 2 more answers
What is gland? mention it's type​
stealth61 [152]

Answer:

Gland is an organ that makes one or more substances, such as hormones, digestive juices, sweat, tears, saliva, or milk.

TYPES OF GLANDS :

ENDOCRINE glands release the substances directly into the bloodstream.

EXOCRINE glands release the substances into a duct or opening to the inside or outside of the body.

BRAINLIEST PLEASE

5 0
2 years ago
Read 2 more answers
What kind of image does this photograph represent?
Drupady [299]
C architecture photograph
8 0
2 years ago
Read 2 more answers
Your sister is starting 9th grade next year and is thinking about going to college. What step would you recommend she take first
lozanna [386]

think about what she wants to do with her life and what collage is best fit for that


5 0
2 years ago
Read 2 more answers
Other questions:
  • \What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
    7·2 answers
  • Which segment of society introduced the grunge look?
    5·2 answers
  • A law office has been leasing dark fiber from a local telecommunications company to connect a remote office to company headquart
    14·1 answer
  • (15 POINTS) When an error is made in HTML code, the browser does what?
    11·1 answer
  • What is the central idea of the second section:
    14·1 answer
  • The computer mouse are used for
    15·2 answers
  • Which mark is an indicator of invalid data in a cell?
    11·1 answer
  • Dynamic programming does not work if the subproblems: ___________
    5·1 answer
  • In 1980, IBM's cheapest computer was more affordable than Apple's.<br><br><br> True<br><br> False
    10·1 answer
  • Three types of query​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!