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
ki77a [65]
3 years ago
7

Write an if statement that assigns 100 to x when y is equal to 0.

Computers and Technology
1 answer:
BARSIC [14]3 years ago
5 0

Answer:

if(y==0)

{

   x=100;

}

Explanation:

The above written if statement is for assigning 100 to x when the value of y is equal to 0.To check the value of the y I have used equal operator == which returns true when the value on it's left side is equal to the value to it's right else it returns false and for assigning the value to y I have used assignment operator =.

First it will be checked that the value y is equal to 0.If the then it return true means the if statement will execute.Inside if statement 100 is assigned to x.

You might be interested in
The ________ occurs when the user presses the enter key without typing a value for an input operation.
Morgarella [4.7K]

The empty input occurs when the user presses the enter key without typing a value for an input operation.

4 0
3 years ago
True or false? The History list shows only Web pages you visited during the current computing session. -computer essentials
Deffense [45]

Answer:

Yes, but if you click on your history you can see all of what you went on for a few days back

Explanation:

4 0
3 years ago
Define the missing method. licenseNum is created as: (100000 * customID) licenseYear, where customID is a method parameter. Samp
g100num [7]

Answer:

I am writing the program in JAVA and C++

JAVA:

public int createLicenseNum(int customID){  //class that takes the customID as parameter and creates and returns the licenseNum

       licenseNum = (100000 * customID) + licenseYear;  //licenseNum creation formula

       return(licenseNum);     }

In C++ :

void DogLicense::CreateLicenseNum(int customID){ //class that takes the customID as parameter and creates the licenseNum

licenseNum = (100000 * customID) + licenseYear; } //licenseNum creation formula

Explanation:

createLicenseNum method takes customID as its parameter. The formula inside the function is:

licenseNum = (100000 * customID) + licenseYear;

This multiplies 100000 to the customID and adds the result to the licenseYear and assigns the result of this whole expression to licenseNum.

For example if the SetYear(2014) means the value of licenseYear is set to 2014 and CreateLicenseNum(777) this statement calls createLicenseNum method by passing 777 value as customID to this function. So this means licenseYear = 2014 and customID  = 777

When the CreateLicenseNum function is invoked it computes and returns the value of licenseNum as:

licenseNum = (100000 * customID) + licenseYear;

                     = (100000 * 777) + 2014

                     = 77700000 + 2014

licenseNum = 77702014                                                                                                        

So the output is:

Dog license: 77702014          

To call this function in JAVA:

public class CallDogLicense {

public static void main(String[] args) {//start of main() function

    DogLicense dog1 = new DogLicense();//create instance of Dog class

dog1.setYear(2014); // calls setYear passing 2014

dog1.createLicenseNum(777);// calls createLicenseNum passing 777 as customID value

System.out.println("Dog license: " + dog1.getLicenseNum()); //calls getLicenseNum to get the computed licenceNum value

return; } }

Both the programs along with the output are attached as a screenshot.

3 0
3 years ago
Read 2 more answers
If you see an advertisement for a 3TB portable drive, this is most likely a reference to the device having a capacity of three
Anika [276]
Hello there.

Question: <span>If you see an advertisement for a 3TB portable drive, this is most likely a reference to the device having a capacity of three _____.

Answer: It is 3 terabytes. .

Hope This Helps You!
Good Luck Studying ^-^</span>
4 0
3 years ago
In cyber security, one of the best ways to protect a computer or network is with a strategy called defense in depth. This strate
emmainna [20.7K]

This idea is most closely related to the Layering in terms of how to reduce complexity.

<h3>Describe cybersecurity?</h3>

The term "cybersecurity" refers to the safeguarding of computer systems and networks against the leakage, theft, or destruction of data as well as the interruption of the services they offer.

Defense in depth is a technique used in cybersecurity that is one of the greatest ways to safeguard a computer or network. If one fails, it's likely that another will identify the issue. The approach to simplifying that is most in line with is called layering.

Thus, This idea is most closely related to the Layering in terms

For further details about cybersecurity, click here:

brainly.com/question/13016321

#SPJ1

5 0
2 years ago
Read 2 more answers
Other questions:
  • This library function returns a random floating point number within a specified range of values. The function returns a random f
    12·1 answer
  • What is the drawback of the linear model?
    5·2 answers
  • Which of the following is NOT a fixed expense?
    6·1 answer
  • Explain how each of the five types of prewriting assist a writer in getting started. please make it short.
    15·1 answer
  • The purpose of an interface is to:___________
    5·1 answer
  • List the gcc command-line options for each of the following: Generate a .o file rather than an executable. Generate a .s (assemb
    6·1 answer
  • Cisco Next Generation Intrusion Prevention System (NGIPS) devices include global correlation capabilities that utilize real-worl
    9·1 answer
  • What is not recyclable in a<br> hybrid car<br> hydrogen car<br> petrol car
    15·1 answer
  • Vector images take up much less space when saved to a computer or storage device because computers and storage devices just need
    14·2 answers
  • In what way, if any, is the impact of a given risk affected by the timing of a project?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!