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
youn need to use your hands
Answer:
The minimum mass flow rate will be "330 kg/s".
Explanation:
Given:
For steam,


For water,


They add energy efficiency as condenser becomes adiabatic, with total mass flow rate of minimal vapor,
⇒ 
On putting the estimated values, we get
⇒ 
⇒ 
⇒ 
Answer:
a) the inductance of the coil is 6 mH
b) the emf generated in the coil is 18 mV
Explanation:
Given the data in the question;
N = 570 turns
diameter of tube d = 8.10 cm = 0.081 m
length of the wire-wrapped portion l = 35.0 cm = 0.35 m
a) the inductance of the coil (in mH)
inductance of solenoid
L = N²μA / l
A = πd²/4
so
L = N²μ(πd²/4) / l
L = N²μ(πd²) / 4l
we know that μ = 4π × 10⁻⁷ TmA⁻¹
we substitute
L = [(570)² × 4π × 10⁻⁷× ( π × (0.081)² )] / 4(0.35)
L = 0.00841549 / 1.4
L = 6 × 10⁻³ H
L = 6 × 10⁻³ × 1000 mH
L = 6 mH
Therefore, the inductance of the coil is 6 mH
b)
Emf ( ∈ ) = L di/dt
given that; di/dt = 3.00 A/sec
{∴ di = 3 - 0 = 3 and dt = 1 sec}
Emf ( ∈ ) = L di/dt
we substitute
⇒ 6 × 10⁻³ ( 3/1 )
= 18 × 10⁻³ V
= 18 × 10⁻³ × 1000
= 18 mV
Therefore, the emf generated in the coil is 18 mV
Answer:
class TriangleNumbers
{
public static void main (String[] args)
{
for (int number = 1; number <= 10; ++number) {
int sum = 1;
System.out.print("1");
for (int summed = 2; summed <= number; ++summed) {
sum += summed;
System.out.print(" + " + Integer.toString(summed));
}
System.out.print(" = " + Integer.toString(sum) + '\n');
}
}
}
Explanation:
We need to run the code for each of the 10 lines. Each time we sum numbers from 1 to n. We start with 1, then add numbers from 2 to n (and print the operation). At the end, we always print the equals sign, the sum and a newline character.