Is this computer science?
If so, then the function you would need for your code is this...
_____
if (someValue%2 != 0) {
value *= -1;
}
_____
//basically <u>number%2 == 0</u> means even so "!" means false so "not even" meaning "odd."
Assuming you are doing an array list (given a set value) or a for-loop with an
int someValue = Integer.parseInt(args[i]); inside (not given a set value and not restricted)
Otherwise ignore me....lol
Answer:
The answer to the given question in the option "a".
Explanation:
In the given c++ program the correct sets value of x and y is option a:
void dClass::setXY(int a, int b) //function implementation
{ //function body.
x = bClass.setX(a); //variable x hold value of setX() function.
b = y; //variable b holds value of y.
}
And other option are not correct that can be described as:
- In option b, x is private variable of the base class that is inherit by the derived class but variable y is not part of the base class. that's why it is wrong.
- In option c, x= a is correct but y=b is not correct. that's why it is wrong.
- In option d we access the value of the private variable x that is a part of the base class but in this we not use any variable that holds its value. that's why it is wrong.
So the answer to this question is the option "a".
Take 4,000 times 12 to get 48,000. that’s how much A costs.
B is a little harder. you have to take (2,300+300)x12+(4*250). this equals $32,100
the correct answer would be B.