Hey!
I believe the answer to 1. Should be A. Rule of Thirds.
Complete Question:
Write a second constructor as indicated. Sample output:User1: Minutes: 0, Messages: 0User2: Minutes: 1000, Messages: 5000// ===== Code from file PhonePlan.java =====public class PhonePlan { private int freeMinutes; private int freeMessages; public PhonePlan() { freeMinutes = 0; freeMessages = 0; } // FIXME: Create a second constructor with numMinutes and numMessages parameters. /* Your solution goes here */ public void print() { System.out.println("Minutes: " + freeMinutes + ", Messages: " + freeMessages); return; }}
Answer:
The second constructor is given as:
//This defines the constructor, the name has to be the same as the class //name
PhonePlan(int numOfMinutes, int numberOfMessages) {
this.freeMinutes = numOfMinutes;
this.freeMessages = numberOfMessages
}
Explanation:
The second constructor is defined using java programming language.
- The given class has two constructors This is called "Constructor Overloading) which implements polymophism
- In the second constructor that we created, we pass in two arguments of type integer numOfMinutes and numberOfMessages.
- In the constructor's body we assign these values to the initially declared variables freeMinutes and freeMessages
Answer:
(i) The rotation speed must stay the same.
(ii) The rotation speed must increase.
(iii) The rotation speed must decrease.
Explanation:
According to Equation
10.10, the angular speed must therefore vary as the laser–lens system moves
radially along the disc. In a typical CD player, the constant speed of the surface at
the point of the laser–lens system is 1.3 m/s.
Answer:
public class GetInfo{
Beverage[] beverages=new Beverage[100];
int i=0;
GetInfo(Beverage b){
beverages[i]=b;
i++;
}
public void Display(){
for(int i=0;i<beverages.length;i++)
cout<<beverage[i].tostring();
}
Explanation:
we are taking Beverages array to store all values and in constructor we are adding that to the list and Display() function prints the vale
Answer:
array = input("Enter the list of computer memory: ").split(',')
int_arr = [int(x) for x in array]
segment = int(input("Enter the length of segment to analyze: "))
list_len = len(int_arr)
segList = []
mini = []
for x,i in enumerate(int_arr):
seg = int_arr[i-1:segment+i-1]
if len(seg) == segment:
segList.append(seg)
for x in segList:
mini.append(min(x))
result = mini.index(min(mini))
print("Segment with the minimum memory is: ",segList[result])
Explanation:
The python program prints out the segment after analysis, with the smallest disk memory space. The code gets the array of computer rows from the user input and segments the array with the number of segment input, then the minimum is compared for all segments in the network.