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
How to solve level 53 on rapid router?
alexgriva [62]

&lt;img src=/static/game/image/actions/go.svg alt=' + ugettext(play= button)= += '= style=width: 4%;&gt; ) def noPermissionMessage():

6 0
2 years ago
Which of the following statements is correct?
vaieri [72.5K]

Answer:

A

Explanation:

I think is A. or maybe search up the topic of the lesson

7 0
4 years ago
Expressions coded in the HAVING clause
HACTEHA [7]

Answer:

A

Explanation:

Expressions coded in the HAVING clause can use either aggregate search conditions or non-aggregate search conditions.

Cheers

7 0
3 years ago
Which type of packet is sent by a dhcp server after receiving a dhcp discover message?
emmasim [6.3K]
A<span> DHCPOffer packet is sent to the client.</span>
5 0
3 years ago
The second finger on the left hand types _____.<br><br> 3 E D C<br> 1 Q A Z<br> 7 U J M<br> 8 I K ,
hram777 [196]
The first finger on the left (Index) is choice "2" (1,Q,A,Z)

The second finger on the right (Middle) is choice "4" (8,I,K)

The first finger on the right (Index) is "3" (7,U,J,M

Which leaves choice "1" (3,E,D,C)

Hope this helps
7 0
4 years ago
Read 2 more answers
Other questions:
  • Who would like to join a team devoted to decreasing spam and bullying?
    5·1 answer
  • Plz answer and dont put a random thing for the points
    11·1 answer
  • What is parallelism of microinstruction
    9·1 answer
  • Implement a java program to find the smallest distance between two neighbouring numbers in an array.
    7·1 answer
  • Words that have a special meaning in a programming language are called
    13·1 answer
  • In a systems development life cycle (SDLC) model, the purpose of the _____ is to create a physical model that will satisfy all d
    10·1 answer
  • Help! I’ll mark you brainly! Please help me.
    15·1 answer
  • Can you help me with this question please ​
    13·1 answer
  • What are the main dimensions of information system and their components
    13·1 answer
  • What is essential for a good study routine? Select four options.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!