Answer:
The given grammar is :
S = T V ;
V = C X
X = , V | ε
T = float | double
C = z | w
1.
Nullable variables are the variables which generate ε ( epsilon ) after one or more steps.
From the given grammar,
Nullable variable is X as it generates ε ( epsilon ) in the production rule : X -> ε.
No other variables generate variable X or ε.
So, only variable X is nullable.
2.
First of nullable variable X is First (X ) = , and ε (epsilon).
L.H.S.
The first of other varibles are :
First (S) = {float, double }
First (T) = {float, double }
First (V) = {z, w}
First (C) = {z, w}
R.H.S.
First (T V ; ) = {float, double }
First ( C X ) = {z, w}
First (, V) = ,
First ( ε ) = ε
First (float) = float
First (double) = double
First (z) = z
First (w) = w
Explanation:
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
Answer:
a)-True
Hope this helps even tho theres no school right now
Independent auto lots usually have <u>higher</u> finance rates than dealerships
<u>Explanation:</u>
The finance rates that are charged by the dealers are lower than the finance charges that are charged by the independent auto. In case if you are getting financed through dealerships, you can also negotiate with them to charge finance rates and lower the charges of the finance.
But this negotiation and lowering of the finance rates is not possible with the independent auto lots and thus they charge higher rates compared to the dealerships.
The relationship between resistance and the area of the cross section of a wire is inversely proportional . When resistance is increased in a circuit , for example by adding more electrical components , the current decreases as a result.