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
A merge is _____.
Aliun [14]
The process of combining information from a variety of sources
7 0
3 years ago
Read 2 more answers
Name the different types of constructors that a designer can provide in a class. Provide an example with a class showing many co
Marrrta [24]
By default, if you do not implement a constructor, the compiler will use an empty constructor (no parameters and no code). The following code will create an instance of the MyObject class using the default constructor. The object will have the default vauesfor all the attributes since no parameters were given.

MyObject obj = new MyObject();

Another type of constructor is one with no parameters (no-arg constructor). It is similar to the default, except you actually create this constructor. The contents of the the constructor may include anything. To call a no-arg constructor, use the same line of code as above. The constructor can look like the one below:

public MyObject() {
System.out.println("This is a no-arg constructor");
}

Lastly there is the parameterized constructor. This type of constructor takes in parameters as inputs to assign to values in the newly created object. You call a parameterized constructor as follows:

MyObject obj = new MyObject("Bob", 20);

The constructor will look like this:

public MyObject(String name, int age) {
this.name = name;
this.age = age;
}

In the constructor, the keyword "this" refers to the object, so this.name is a private global variable that is being set equal to the inputted value for name, in this case "Bob".

Hope this helps!
8 0
3 years ago
Suppose that the content of the input file is: 14 13 26 8 -11 36 0 -1. What is the output of the following code? ifstream myInfi
tester [92]
I do not know, i really hope you dont fail!!!!!!!!!
3 0
3 years ago
Read 2 more answers
CHKDSK is a system utility that is commonly found in Windows. What is CHKDSK? Use the Internet to research and write about CHKDS
Alex_Xolod [135]

chkdsk is a utility that you use to check for bad sectors on a hard drive , as far as how to run it you open the start menu go to your run bar and type chkdsk then follow the instruction on the screen .

6 0
3 years ago
Read 2 more answers
What game is the best for racing and modifying cars
sleet_krkn [62]

Answer:  it is Forza Horizon 4. ...

Best Car Games

1.Forza Horizon 4

2. Grand Theft Auto V

3. Need For Speed Payback

4. Car Mechanic Simulator

5. Forza Horizon 4

6. Rocket League

Explanation:

6 0
3 years ago
Other questions:
  • I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
    13·1 answer
  • Write a recursive function that calculates if two binary trees are similar?
    14·1 answer
  • What does it mean to say that two variables are negatively correlated?
    6·1 answer
  • When a user utilizes another computer to communicate with a third party, with the result that the third party cannot recognize t
    8·1 answer
  • Select the term below which is a protocol that provides a method for software components to communicate, interact, and share dat
    6·1 answer
  • I’m nobody. Who are you?
    9·2 answers
  • Easy coding question, please help.
    13·1 answer
  • What does 69 mean?<br> Whenever I watch memes they always talk about the number 69
    8·2 answers
  • Consider the following declaration:
    9·1 answer
  • Cara is cleaning her computer when she notices a loose cable connecting to her printer. Which two ports would the cable most lik
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!