Answer:
Code is in the attached screenshot.
Explanation:
Assumed it was written in Java based on your other question asked.
Answer:
69.54
Explanation:
A power ratio of 9000000:1 corresponds to 69.54 dB.
The calculation is presented below:
Formula for calculating Power ratio (db) = 10 * log [P(out)/P(in)]
Since the given ratio is 9000000:1, substituting in the formula gives us 10 * log (9000000/1)
Note that log 9000000 = 6.954
Therefore, 10 * log (9000000/1) = 69.54
Hence the required power ratio in db is 69.54 db.
Question options:
a. RAID 0
b. RAID 1
c. RAID 5
d. RAID 6
e. RAID 10
Answer:
d. RAID 6
Explanation:
RAID is Redundant Array of Inexpensive/Independent Disks. RAID combines low cost physical hard disk drives in one hard disk drive. RAID is used to achieve data redundancy(data backup but with synchronization) or improved performance or both.
To get what the director requires he would need to use RAID 6. RAID 6 is RAID level optimized to achieve data redundancy but with slow performance.
Answer:
String date = "21/05/2020";
String dayStr = date.substring(0,2);
int day = Integer.parseInt(dayStr);
System.out.println(day);
Explanation:
Create a variable called <em>date</em> which holds the current date
Create a variable called <em>dayStr</em>. Initialize it to the day part of the <em>date</em> using the substring method
Create a variable called <em>day</em>. Parse the <em>dayStr</em> and assign it to the <em>day</em>
Print the <em>day</em>
Answer:
See Explaination
Explanation:
class MagicSquare():
def __init__(self,side):
self.side=side
self.two_dimension=[]
for row in range(1,side+1):
row_line=[]
for col in range(1,side+1):
row_line.append(0)
self.two_dimension.append(row_line)
def display(self):
row=0
col=int((self.side-1)/2)
for i in range(1,self.side**2+1):
self.two_dimension[row][col]=i
row-=1
col+=1
if row==-1:
row=self.side-1
if col==self.side:
col=0
if self.two_dimension[row][col]==0:
continue
else:
row+=1
if row==self.side:
row==0
for line in self.two_dimension:
for num in line:
print("{0:>3}".format(num),end=" ")
print()
def main():
for i in range(1,14,2):
square=MagicSquare(i)
square.display()
print("----------------------------------------------------")
if __name__ == '__main__':
main()