Answer:
For most space objects, we use light-years to describe their distance. A light-year is the distance light travels in one Earth year. One light-year is about 6 trillion miles (9 trillion km). That is a 6 with 12 zeros behind it!
Answer:
The given statement is false statement.
Explanation .
- The assignment is assigning the value to the variable or we can say that it will also be used to initialize the variable The "=" is the symbol of the assignment operator.
int r=90, The value of variable 90 is assigned to 90.
- The associativity, of assignment, is always right to left which means The right-hand side is firstly evaluated then it will be assigned in left-hand side variable or expression.
Answer:
Explanation:
This would be considered a setter method. In most languages the parameter of the setter method is the same as the variable that we are passing the value to. Therefore, within the function you need to call the instance variable and make it equal to the parameter being passed. It seems that from the function name this is being written in python. Therefore, the following python code will show you an example of the Employee class and the set_age() method.
class Employee:
age = 0
def __init__(self):
pass
def set_age(self, age):
self.age = age
As you can see in the above code the instance age variable is targeted using the self keyword in Python and is passed the parameter age to the instance variable.
Answer:
MYSTRUCT myStruct[8]; // statemnt to create an array of struct variables
myStruct[3].buf[4] // statement to access the fourth element of the array of the struct variables.
struct * MYSPTR = &myStruct; // This statement creates a pointer.
To dereference and access the S variable of the struct data structure in the array;
(*MYSPTR).S and its shorthand notation MYSPTR -> S
Explanation:
A structure is a data structure in C language that is used to hold descriptive data of an object. The keyword struct is used to create the structure. An array of struct holds instances of a struct variable, where each struct can be accessed using the regular array indexing and the variables of the structs in the array can be accessed using dot notation.
Answer:
The pseudocode is as follows
1. Input Steps
2. Input Day
3. Miles = Steps/2000
4. Calories = 65 * Miles
5. Print Calories
6. Stop
Explanation:
This line gets the number of steps for the day
1. Input Steps
This line gets the current day
2. Input Day
The line calculates number of miles
3. Miles = Steps/2000
This line calculates the calories lost
4. Calories = 65 * Miles
This line prints the calories lost
5. Print Calories
The pseudocode ends here
6. Stop