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
What are some catchy names for computer basics that you would put on a childrens poster?
Triss [41]

Answer:

not sure

Explanation:

6 0
3 years ago
Create a function printInfo(some_dict) that given a dictionary whose values are all lists, prints the name of each key along wit
aleksandrvk [35]

Answer:

def printInfo(some_dict):

   print(len(some_dict['locations']), "LOCATIONS")

   for location in some_dict['locations']:

       print(location)

   print()

   print(len(some_dict['instructors']), "INSTRUCTORS")

   for location in some_dict['instructors']:

       print(location)

seattle = {

   'locations': ['San Jose', 'Seattle', 'Dallas', 'Chicago', 'Tulsa', 'DC', 'Burbank'],

   'instructors': ['Michael', 'Amy', 'Eduardo', 'Josh', 'Graham', 'Patrick', 'Minh', 'Devon']

}

printInfo(seattle)

Explanation:

7 0
3 years ago
What are some benefits that each computer system being used?
lisabon 2012 [21]

Answer:

Computerised accounting systems have numerous benefits to them and below are the top nine points as to why you should be using them with your business.

Automation. ...

Data Access. ...

Accuracy. ...

Reliability. ...

Speed. ...

Security. ...

Scalable. ...

Visuals.

Explanation:

hope this helps!

6 0
2 years ago
Read 2 more answers
What is the name of the technology that integrates vast data bases with georeferenced data in order to design, plan, and manage
ivanzaharov [21]

Answer:

"Geographic information systems " is the right answer.

Explanation:

  • This is indeed a computer-based method for observing and analyzing current events that are happening on the planet. GIS could enhance teaching and learning begin to understand geographical trends and regularities by relaying completely unconnected information.
  • It represent an experimental field and while the GIS supplier government offers us modern, improved, and quicker technical resources for the computer hardware.
7 0
3 years ago
Which all frameworks are developed using Scala
Alexandra [31]

Akka. Speaking of high concurrency tools written in Scala, Akka is an extremely fast, extremely concurrent framework for building distributed applications. ... Similar to Finagle, Akka is written in Scala and provides both Scala and Java APIs.

8 0
3 years ago
Other questions:
  • ?the single most effective security measure for digital devices is to password protect access to them.
    5·1 answer
  • I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the
    14·1 answer
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • What is the output after running the following code snippet? int number = 600; if (number &lt; 200) { System.out.println("Low sp
    15·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • You have just finished installing a network adapter adapter and booted up the system, the drivers. You open File Explorer on a r
    13·1 answer
  • 14. Which of the following is NOT likely to be one of the future development gaming industry?
    7·1 answer
  • Need the answer ASAP!!!
    5·1 answer
  • In the previous project, you are storing the first name of the gamer. Write a phrase to the game right before the first word wit
    6·1 answer
  • What is software? Why is it needed?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!