Answer:
x=2
x=1
x=2
Explanation:
a)
This if statement if (1+2=3) checks if the addition of two numbers 1 and 2 is true. Here the addition of 1 and 2 is 3 which is true. So the condition becomes true.
Since the condition is true x:=x+1 statement is executed. This statement means that the value of x is incremented by 1.
The value of x was 1 before the if statement is reached. So x:=x+1 statement will add 1 to that value of x.
x:=x+1 means x=x+1 which is x=1+1 So x=2
Hence value of x is 2 (x=2) after the execution of x:=x+1
b)
In statement b the value of x will be 1 because both the mathematical operations in the if statement evaluate to false.
which means in b, x:=x+1 will not be executed and value of x remains unchanged i.e x=1
In (c) the value x will be 2 because the condition in the if statement is true. Both mathematical expressions 2+3=5 and 3+4=7 are true. Therefore x:=x+1 will be executed and value of x will be incremented by 1. Hence x=2
Answer:
see explaination
Explanation:
class Taxicab():
def __init__(self, x, y):
self.x_coordinate = x
self.y_coordinate = y
self.odometer = 0
def get_x_coord(self):
return self.x_coordinate
def get_y_coord(self):
return self.y_coordinate
def get_odometer(self):
return self.odometer
def move_x(self, distance):
self.x_coordinate += distance
# add the absolute distance to odometer
self.odometer += abs(distance)
def move_y(self, distance):
self.y_coordinate += distance
# add the absolute distance to odometer
self.odometer += abs(distance)
cab = Taxicab(5,-8)
cab.move_x(3)
cab.move_y(-4)
cab.move_x(-1)
print(cab.odometer) # will print 8 3+4+1 = 8
Answer:
Option(c) is the correct answer to the given question .
Explanation:
The Project responsibilities section is responsible of the planning of project.
Following are the Roles of the Project Responsibilities
- To check the objective of the project goals.
- Works with customers and to define and meet client needs and the overall objective .
- Cost estimation and expenditure production of the project
- Ensure the fulfillment of the client .Analysis and enterprise risk management. and Tracking the progress of project.
All the others options are not responsible of the planning of project that's why Option(c) is the correct answer .
Answer:
A, B and D
Explanation:
The kernel is the central core of the computer's operating system, that has total control of all the activities of the computer. The kernel is a very small program in memory and runs first during the boot of the system. It is the interactive link between the hardware and operating system and other system softwares.
The uses a command line to receive and execute command for various system configurations like storage and memory mapping, enable and disable interrupts, set timers or allocate time slice to run programs etc.