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
Maru [420]
3 years ago
13

Why would a programmer use a “public” variable for something like speed? Provide at least two other examples of variables a deve

loper would likely make “public.”
Computers and Technology
1 answer:
agasfer [191]3 years ago
7 0

It is useful for things that you don't need to redefine, and you may need to use to compute different things (such that you have different modules/functions to compute each one of these things).

<h3><u>What is a public variable?</u></h3>

A public variable is a variable that any function, sub procedure, or module can access without restriction.

Thus, if you want to define a variable only once and be able to call it from different functions or modules when you need it, you would want to make it a public variable.

An example with speed is:

You can make a simple code that for an initial speed computes the position vs time graph.

But you may want to expand that program, let's say that you make a module that also allows you to find the momentum or something like that (where you also need to use the speed).

Then defining the speed as public, is useful, as you can only call it with the module or function that you use to find the momentum.

Another example, maybe more complete.

Assume that you work with radiation physics. You define a mean energy of radiation (this would be the energy of the x-rays for example).

Now if you define that variable as public, you could use it for a lot of modules to compute a lot of different things, like fluency, kermas, etc.

Things that are really complex to compute and you may have the codes for each one in different modules/functions.

So it is really useful when you already had several codes that work with the same variable.

If you want to learn more about variables, you can read:

brainly.com/question/15683939

You might be interested in
1. Science is the body of knowledge and methods produced by engineering.
olga nikolaevna [1]
True. Technology changes society
6 0
3 years ago
if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
Pie

Answer:

every single day of my life

7 0
3 years ago
Read 2 more answers
PLEASE HELP! WILL MARK AS BRAINLIEST!
insens350 [35]

Answer:

JavaScript can be implemented using JavaScript statements that are placed within the HTML tag

Explanation:

6 0
3 years ago
Read 2 more answers
What are the function of INPUT unit ? In point ​
Alex17521 [72]

Answer:

Inputs are very helpful

Explanation:

Inputs can be inputing a string, interger, or basically any value.  If you want to have an output you need an input and compiler (with minor differences).

Lets say y is out input our compiler is y + 5, and out output is x.

y + 5, that makes x 10.

Hope this helps :D

6 0
3 years ago
A _____ is a computer network that connects computers within a school.
Savatey [412]
Usually a LAN (Local Area Network), but it's not a requirement. A WAN (Wide Area Network) would need to be used in a multi-campus setup.
3 0
3 years ago
Other questions:
  • Because an AVL tree is a binary search tree, the search algorithm for an AVL tree is the same as the search algorithm for a bina
    10·1 answer
  • what are the products of light-dependent reactions? Why are they important in lighy independent reactions?​
    6·2 answers
  • Why is operating system pivotal in teaching and learning
    11·1 answer
  • True or False <br><br> Rootkits are only made by black-hat hackers.
    8·1 answer
  • Peyton is having trouble searching for information on butter lettuce. Every time he searches for it, he gets some results for bu
    6·2 answers
  • _______ is the use of software to assist in the creation, analysis, and modification of the design of a component or product.
    9·1 answer
  • After a Hacker has selects her target, performed reconnaissance on the potential target's network, and probed active Internet Ad
    13·1 answer
  • Assuming a single-processor system, that load and store are atomic, that x is initialized to 0, and that x must be loaded into a
    8·1 answer
  • Write the pseudocode for a program that will process attendance records of CA students. The students attend college five days a
    13·1 answer
  • An algorithm to find the perimeter of a triangle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!