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
marysya [2.9K]
3 years ago
7

Know when the double, int, String, and char data types are best used. Example: I would store a social security number in a strin

g because the social can contain dashes and it is only used for displaying not for a mathematical equation.
Computers and Technology
1 answer:
lidiya [134]3 years ago
4 0
A double is best used for numbers that are real, as in they have a decimal. Int is best used for numbers that are whole, as in no decimal. Strings are best used, as in the example you gave, when you have to represent a piece of information that isn’t strictly numbers
You might be interested in
The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods a
professor190 [17]

<u>Answer:</u>

CIRCLE.JAVA

public class Circle {

  <em>private</em><em> </em>double radius;

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

<u>Explanation:</u>

public class Circle {

  //This could be made private or public.

  //Making it private is better

  <em>private</em><em> </em>double radius;

  //This is a constructor. It should be made public

  //since it would most likely be used in another class

  //to create an object of this class.

  //Making it private means no other external class can create

  //an object of this class.

  //Since the tester class (CIRCLETESTER.java), as shown on line 3,

  // needs to create

  //an object of this class, this should be made public

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 //This should be made public since it will be

// used in another class (CIRCLETESTER.java in this case)

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 //This should be made public since it will be

 //used in another class (CIRCLETESTER.java)

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 //The toString() method is the string representation

 //of an object and is called when there is an attempt to

 //print the object. It should be made public since it will

 //be used in another class (CIRCLETESTER.java)

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

8 0
2 years ago
One of the most famous ___ licenses is gpl, which ensures that a particular program remains free to distribute and allows its co
stich3 [128]
One of the most famous EULA licenses is GPL, which ensures that a particular program remains free to distribute and allows its code to be examined and modified by anyone. EULA stands for End User License Agreement. It is the agreement between the licensor and purchaser, where the <span>purchaser is given </span><span>right of using the software. 
GPL is the GNU General Public License.</span>
6 0
3 years ago
In round-robin scheduling,a) the time quantum should be larger than the context switch time. b) the time quantum should be as sm
pickupchik [31]

Answer: d. the time quantum should be as small as possible.

Explanation: Round robin is a CPU scheduling algorithm. If the time quantum is extremely small, number of context switches is very high, round robin scheduling will be same as processor sharing algorithm. Then the algorithm is good. Very large time quantum will make response time of processes too much which may not be tolerated in interactive environment.

3 0
2 years ago
Discuss the advantages of using analogue multi-tester or digital multi-tester over the other.​
QveST [7]

Answer:

Advantages of Digital Multimeters:

1)They are more accurate than analog multimeters.

2)They reduce reading and interpolation errors.

3)The 'auto-polarity' function can prevent problems from connecting the meter to a test circuit with the wrong polarity.

4)Parallax errors are eliminated.

I hope this helps.

8 0
2 years ago
What is the answer only right answers<br>​
Molodets [167]

Answer:

hmm....

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • One of the original forms of viruses, is usually stored on some form of removable media. When the removable media is connected t
    9·1 answer
  • To connect a peripheral device to a computer to exchange data, find the appropriate ________ for the device.
    7·1 answer
  • You can rotate a selected graphic by dragging a ________ rotation handle
    13·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • Which of the following might cause a shift from PPF1 to PPF2? I. A new source of high quality denim fabric. II. A new lighter me
    12·1 answer
  • In C, how could I use a command line input to remove certain characters from an existing string? For example, if I have string '
    8·1 answer
  • I have been charged for brainly plus yet I still have to watch ads why? What do I do?
    12·2 answers
  • The used of PPE in the shop includes the following, except:
    10·2 answers
  • Qwertyuiopasdfghjklzxcvbnm??
    14·2 answers
  • A class is a type of object that defines the format of the object and the actions it can perform. True False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!