Answer:
Code is given below:
Explanation:
.data
str1: .space 20
str2: .space 20
msg1:.asciiz "Please enter string (max 20 characters): "
msg2: .asciiz "\n Please enter string (max 20 chars): "
msg3:.asciiz "\nSAME"
msg4:.asciiz "\nNOT SAME"
.text
.globl main
main:
li $v0,4 #loads msg1
la $a0,msg1
syscall
li $v0,8
la $a0,str1
addi $a1,$zero,20
syscall #got string to manipulate
li $v0,4 #loads msg2
la $a0,msg2
syscall
li $v0,8
la $a0,str2
addi $a1,$zero,20
syscall #got string
la $a0,str1 #pass address of str1
la $a1,str2 #pass address of str2
jal methodComp #call methodComp
beq $v0,$zero,ok #check result
li $v0,4
la $a0,msg4
syscall
j exit
ok:
li $v0,4
la $a0,msg3
syscall
exit:
li $v0,10
syscall
methodComp:
add $t0,$zero,$zero
add $t1,$zero,$a0
add $t2,$zero,$a1
loop:
lb $t3($t1) #load a byte from each string
lb $t4($t2)
beqz $t3,checkt2 #str1 end
beqz $t4,missmatch
slt $t5,$t3,$t4 #compare two bytes
bnez $t5,missmatch
addi $t1,$t1,1 #t1 points to the next byte of str1
addi $t2,$t2,1
j loop
missmatch:
addi $v0,$zero,1
j endfunction
checkt2:
bnez $t4,missmatch
add $v0,$zero,$zero
endfunction:
jr $ra
Waves in the electric and magnetic fields are known as electromagnetic waves. You must first understand what a field is, which is just a technique of giving each square inch of space a numerical value. You may see that as a temperature field, for instance, when you look at the weather predictions and they mention the temperature in several locations. Every location on Earth has a unique temperature that can be quantified. Everywhere on Earth has its own wind velocity, which is another form of field. This field differs somewhat from the temperature field in that the wind velocity has both a direction and a magnitude, whereas the temperature just has a magnitude (how hot it is). A vector is a quantity that has both magnitude and direction, hence a field that contains vectors at every location is referred to as a vector field. Vector fields include the magnetic and electric fields. We may examine what would happen if we placed a charged particle at any given position in space. If the charged particle were to accelerate, we would state that the electric field there is the direction in which the particle is moving. In general, positively charged particles will move in the electric field's direction, whereas negatively charged particles will move in the opposite way. Because it is a vector field, the magnetic field exhibits comparable behavior. We discovered in the 19th century that the same interaction, electromagnetism, really produces both electric and magnetic fields. Like an electromagnet, a changing electric field will produce a magnetic field, and a changing magnetic field will induce an electric field (like in a generator). If your system is configured properly, you may have an electric field that fluctuates, which in turn produces a magnetic field, which in turn induces another electric field, which in turn generates another magnetic field, and so on indefinitely. At the speed of light, this oscillation between a strong magnetic field and strong electric field spreads out indefinitely. In reality, light is an electromagnetic wave—an oscillation in the electromagnetic fields. An electric or magnetic field may exist without a medium since they exist in a vacuum, which implies that waves in these fields don't require a medium like sound to flow through.
Answer:
Using python
num_boys = int(input("Enter number of boys :"))
num_girls = int(input("Enter number of girls :"))
budget = int(input("Enter the number of dollars spent per school year :"))
try:
dollarperstudent = budget/(num_boys+num_girls)
print("Dollar spent per student : "+str(dollarperstudent))#final result
except ZeroDivisionError:
print("unavailable")
Answer:
Explanation:if you stretch the hose more tightly the speed of the pulse will reduce..