The answer that best answer this question is A
Answer:
Check the explanation
Explanation:
.data
prompt: .asciiz "Please enter your string :"
result_str: .asciiz "\nYour captalized string :"
error_prompt: .asciiz "\nInvalid Entry !"
buffer: .space 20
.text
.globl __start
__start:
ASKING_STR:
la $a0,prompt
li $v0,4
syscall
li $v0,8 #take in input
la $a0, buffer #load byte space into address
li $a1, 20 # allot the byte space for string
move $t0,$a0 #save string to t0
syscall
li $v0, 4
li $t0, 0
loop:
lb $t1, buffer($t0)
beq $t1, 0, exit
slti $t2,$t1,91
bne $t2,$0,UPPER_CHECK
slti $t2,$t1,123
bne $t2,$0,LOWER_TO_UPPER
UPPER_CHECK:
slti $t2,$t1,65
bne $t2,$0,INVALID_ENTRY
slti $t2,$t1,90
bne $t2,$0,NEXT
j INVALID_ENTRY
LOWER_TO_UPPER:
sub $t1, $t1, 32
sb $t1, buffer($t0)
NEXT:
addi $t0, $t0, 1
j loop
INVALID_ENTRY:
li $v0, 4
la $a0, error_prompt
syscall
j ASKING_STR
exit:
li $v0, 4
la $a0, result_str
syscall
li $v0, 4
la $a0, buffer
syscall
li $v0, 10
syscall
I dont think it matters just as long you have all your things to work it doesnt matter if you have to tape it on your back
It is government regulations and acceptable use policy
Answer:
c. StringBuilder
Explanation:
An alternative to the String class would be the StringBuilder Class. This class uses Strings as objects and allows you to mix and match different strings as well as adding, removing, implementing, and modifying strings themselves as though they were similar to an array. Unlike the string class StringBuilder allows you to modify and work with a combination of strings in the same piece of data as opposed to having various objects and copying pieces which would take up more memory.