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]
2 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]2 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
Xbrl taxonomy: is the document format used to produce web pages. is the final product (report. is a classification scheme. is a
frosja888 [35]
The answer to this is "is a classification scheme"..hope that helped
3 0
3 years ago
In this exercise you will debug the code which has been provided in the starter file. The code is intended to do the following:
abruzzese [7]

Answer:

The corrected code is as follows:

import java.util.Scanner;

public class U2_L4_Activity_Two{

public static void main(String[] args){

Scanner scan = new Scanner(System.in);

String str1 = scan.nextLine();

String str2 = str1;

str1 = str1.toUpperCase();

System.out.println(str1);

System.out.println(str2);

}

}

Explanation:

This corrects the scanner object

Scanner scan = new Scanner(System.in);

This line is correct

String str1 = scan.nextLine();

This copies str1 to str2

String str2 = str1;

This converts str1 to upper case

str1 = str1.toUpperCase();

This prints str1

System.out.println(str1);

This prints str2

System.out.println(str2);

8 0
3 years ago
What are the limits of hashing and verifying that files haven’t changed?
earnstyle [38]

The hashing function can take any number of key-value pairs and there is no specific limit to it.

<h3>What is hashing?</h3>

Hashing is a file-based algorithm for producing a fixed-length bit string value. A file is essentially a collection of data blocks. The length of the data is reduced by hashing to a fixed number or key that represents the original string.

When hashing is employed, the hash function may plot all of the keys and values to what the real size of the table is, demonstrating that the hashing function can take any number of key-value pairs with no restriction.

However, if the passwords are hashed in encryption, recovering the passwords is extremely difficult.

Thus, the hashing function can take any number of key-value pairs and there is no specific limit to it.

Learn more about the hashing here:

brainly.com/question/13106914

#SPJ1

5 0
2 years ago
What is the Difference between CUI and GUI
Fynjy0 [20]

Hi there!


GUI Means Graphical user interface


CUI means  Controlled Unclassified Information


Theres the difference they are completely different from each other.


PLEASE MARK BRAINLIEST

-WeasuLL

7 0
3 years ago
Read 2 more answers
Consider the following statements: struct supplierType { string name; int supplierID; }; struct paintType { supplierType supplie
Romashka [77]

Answer:

The answer is "supplierType"

Explanation:

Description of the code:

  • In the given program two structure is defined, that is "supplierType and paintType", in which "supplierType" structure two-variable name and "supplierID" is defined, that datatype is "String and integer".
  • In the next step, "paintType" is declared, in which "supplierType" object supplier is created, in which two string variable "color and paintID" are defined, in which "supplierType" data type is supplied.
3 0
3 years ago
Other questions:
  • to prevent long page load time for pages containing images. It is best to use a compress file formatlike jpeg as well as appropr
    6·2 answers
  • Which of the following is an encryption tool that allows users to encrypt files and folders by simply right-clicking a given obj
    10·2 answers
  • When you are working on an unsaved document on a PC, where is the document temporarily saved?
    5·1 answer
  • Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"
    14·1 answer
  • The length property of the String object returns
    15·1 answer
  • A game developer is purchasing a computing device to develop a game and recognizes the game engine software will require a devic
    7·1 answer
  • Can maybe someone play with me on Over-watch on the Xbox?
    8·1 answer
  • Differences between analog computer and hybrid computer​
    5·2 answers
  • Sharl downloads images from an online library and uses them in her work. The images are shared under the Creative Commons Attrib
    13·1 answer
  • A web application with an SQL server database is found to be compromised by an attacker. On examination, the email IDs of the da
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!