Answer:
A
Explanation:
The value will be the original stored in the int variables. This is because the method swap(int xp, int yp) accepts xp and yp parameters by value (They are passed by value and not by reference). Consider the implementation below:
public class Agbas {
public static void main(String[] args) {
int xp = 2;
int yp = xp;
swap(xp,yp); //will swap and print the same values
System.out.println(xp+", "+yp); // prints the original in values 2,2
int xp = 2;
int yp = 5;
swap(xp,yp); // will swap and print 5,2
System.out.println(xp+", "+yp); // prints the original in values 2,5
}
public static void swap(int xp, int yp){
int temp = xp;
xp = yp;
yp = temp;
System.out.println(xp+", "+yp);
}
}
Answer:
B . It amplifies the power to speed up the motor and generate more torque
Answer:
The answer to this question can be given as:
Program:
#define class.
class PersonInfo:
def __init__(self): #constructor
self.num_kids = 0
def inc_num_kids(self): #define function inc_num_kids()
self.num_kids = self.num_kids + 1
return self.num_kids #return value.
p= PersonInfo() # creating object
print('Kids:', p.num_kids) #print value
p.inc_num_kids() #call function
print('New baby, kids now:', p.num_kids) #print value
Output:
Kids: 0
New baby, kids now: 1
Explanation:
The description of the above python program as follows:
- In this program firstly we define the class that is PersonInfo. In this class we define the constructor that is def __init__() and one function that is def inc_num_kids().
- The constructor is called automatically when the class object is created. In this constructor, we use the self as a parameter that is used to access variables that belong to class.
- In the constructor, we define the variable that is "num_kids". We assign value to a variable that is "0" and use the self for holding reference to the variable.
- Then we define the function. In this function, we increment the value of the variable by 1 and return its value.
- Then we create a class object that is p and call the function and print its value.
Answer:
d. all of the above.
Explanation:
Since the advent of digital technology, production of goods and services have experienced a significant change from the traditional methods of production. This paradigm shift is made possible by the application of various modern technology.
Production processes are generally being facilitated and enhanced by the use of;
1. Computer-integrated manufacturing (CIM).
2. Computer-aided process planning (CAPP).
3. Computer-aided design (CAD).
4. Computer numerical control (CNC).
In the process of selecting an activity of the production phase:
1. A web authoring tool is often used.
2. The graphics, web pages, and other components are created.
3. The web pages are individually tested.
def replace_at_index(txt, ind, let):
new_txt = ""
for x in range(len(txt)):
if x == ind:
new_txt += let
else:
new_txt += txt[x]
return new_txt
print(replace_at_index(input("Enter a word or phrase: "), int(input("Enter an index value: ")), input("Enter the new letter: ")))
I wrote my code in python 3.8. I hope this helps.