1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
swat32
3 years ago
12

Write a function named joinStrings() that keeps asking the user for words and joins them together. Each word should start with a

n uppercase letter and the rest of letters in the word should be lowercase. All the words should be separated by a space. When the user decides to stop, return the joined string
Computers and Technology
1 answer:
Tamiku [17]3 years ago
4 0

Answer:

* The code is in Python

def joinStrings():

   join = ""

   while True:

       str = input("Enter a word or Q to stop: ")

       if str == "Q":

           break

       else:

           join = join + " " + str

   return join

print(joinStrings())

Explanation:

Create a function called joinStrings

Initialize join variable to hold the strings that will be combined

Create a while loop that stops when user enters "Q". Otherwise, ask the user for a new string and join it to the join variable with a space

When the loop is done, return the join

Call the function and print the result

You might be interested in
Arrange the steps in a sequence that you would follow while sorting data in a spreadsheet.
ss7ja [257]

Answer:

  1. In the spreadsheet menu, click the Data option.
  2. Select the column to sort.
  3. In the submenu of Data, click the Sort… option.
  4. In the Sort dialog box, click the “ascending” option for the  first sort criteria.
  5. Click OK.

Explanation:

The correct sequence is as shown above.

3 0
3 years ago
A hard drive with a spin speed of 7200 RPM, commences spinning at time = 0, at time = 1.326 ms what is the angle that the disk h
Flura [38]

Answer: I. 57º 17'   II. 1 rad.

Explanation:

A spin speed, implies the relationship between the angle rotated and the time  that has been spinning, which is equal, by definition, to the angular velocity.

ω = Δ∅ / Δt

In order to get the angle rotated in degrees, we need to convert first from RPM (revolutions per minute) to º/sec, as follows:

7200 rev/min *( 1 min/60 sec)* (360º/ 1 rev) = 7200* 6= 43200 º/s

Now, we know that the time passed since it started to spin, was 1.326 msec, i.e., 0.001326 sec.

Remembering that  ω = Δ∅ / Δt, solving for Δ∅, we get:

Δ∅ = 43200 º /s * 0.001326 sec = 57º 17'

II. In order to get the answer in rads, we can convert the rpm to rads/sec, as follows:

7200 rev/min *( 1 min/60 sec)* (2 π/ 1 rev) = 240 π rad/sec.

Applying the same equation as above, we get:

Δ∅ = 240 π rad/s * 0.001326 sec = 1 rad.

7 0
4 years ago
What is the area on a machine where work is actually being performed and
zhenek [66]

Answer:

Point of operation guarding

Explanation:

Point of operation guarding. Point of operation is the area on a machine where work is actually performed upon the material being processed. The point of operation of machines whose operation exposes an employee to injury, shall be guarded.

5 0
3 years ago
Purpose of this project is to increase your understanding of data, address, memory contents, and strings. You will be expected t
STALIN [3.7K]

Answer:

See explaination for the details

Explanation:

#Starting point for code/programm

main:

la $a0,newLine #Print a new line

li $v0,4

syscall

# Find the number of occurence of a string in the given sentence

la $a0,prompt1 # Prompt the user to enter the first string.

li $v0,4

syscall

li $v0, 8 # Service 8 = read input string

la $a0, fword

li $a1, 9

syscall

la $a0,prompt2 # Prompt the user to enter the second string.

li $v0,4

syscall

li $v0, 8 # Service 8 = read input string

la $a0, sword

li $a1, 9

syscall

# process first word

li $t4,0 # Intialize the couter to 0

la $t0,sstatement # Store the statement into $t0

nstart1: la $t1,fword # Store the search word into $t1

loop1: # loop1 finds the number of occurences

# of input word in the given statment

lb $t2,($t0) # Load the starting address(character) of

# sstatement into $t2

lb $t3,($t1) # Load the starting address of input word

# into $t3

beq $t3,'\n',inc_counter1

beqz $t3,inc_counter1 # If $t3 is null , exit loop and print output

beqz $t2,print_output1 # If $t2 is null , exit loop and print output

move $a0,$t2 # Convert $t2 to lower, if it is upper case

jal convert2lower

move $t2,$v0 # Store the return($v0) value into $t2

move $a0,$t3 # Convert $t3 to lower, if it is upper case

jal convert2lower

move $t3,$v0 # Store the return($v0) value into $t3

bne $t2,$t3,next_char1 # If both characters are not matched current

# character in the string, go to next character

addiu $t0,$t0,1 # otherwise, increment both indexes

addiu $t1,$t1,1

j loop1 # go to starting of the loop

next_char1:

la $t5,fword

bne $t5,$t1,nstart1

la $t1,fword # Store the input word into $t1

addiu $t0,$t0,1 # Increment the index to goto next character

j loop1 # go to starting of the loop

inc_counter1:

addi $t4,$t4,1 # Increment the frequency counter by 1

la $t1,fword # Store input word into $t1

j loop1 # go to starting of the loop

print_output1:

la $t0,fword

L1:

lb $a0,($t0)

beq $a0,'\n',exL1

jal convert2upper

move $a0,$v0

li $v0,11

syscall

addiu $t0,$t0,1

j L1

exL1:

la $a0,colon

li $v0,4

syscall

la $a0, dash

li $v0, 4

syscall

move $a0,$t4

li $v0,1

syscall # print new line

la $a0,newLine

li $v0,4

syscall

# process second word

li $t4,0 # Intialize the couter to 0

la $t0,sstatement # Store the statement into $t0

nstart2: la $t1,sword # Store the search word into $t1

loop2: # loop1 finds the number of occurences

# of input word in the given statment

lb $t2,($t0) # Load the starting address(character) of

# sstatement into $t2

lb $t3,($t1) # Load the starting address of input word

# into $t3

beq $t3,'\n',inc_counter2

beqz $t3,inc_counter2 # If $t3 is null , exit loop and print output

beqz $t2,print_output2 # If $t2 is null , exit loop and print output

move $a0,$t2 # Convert $t2 to lower, if it is upper case

jal convert2lower

move $t2,$v0 # Store the return($v0) value into $t2

move $a0,$t3 # Convert $t3 to lower, if it is upper case

jal convert2lower

move $t3,$v0 # Store the return($v0) value into $t3

bne $t2,$t3,next_char2 # If both characters are not matched current

# character in the string, go to next character

addiu $t0,$t0,1 # otherwise, increment both indexes

addiu $t1,$t1,1

j loop2 # go to starting of the loop

next_char2:

la $t5,sword

bne $t5,$t1,nstart2

la $t1,sword # Store the input word into $t1

addiu $t0,$t0,1 # Increment the index to goto next character

j loop2 # go to starting of the loop

inc_counter2:

addi $t4,$t4,1 # Increment the frequency counter by 1

la $t1,sword # Store input word into $t1

j loop2 # go to starting of the loop

print_output2:

la $t0,sword

L2:

lb $a0,($t0)

beq $a0,'\n',exL2

jal convert2upper

move $a0,$v0

li $v0,11

syscall

addiu $t0,$t0,1

j L2

exL2:

la $a0,colon

li $v0,4

syscall

la $a0, dash2

li $v0, 4

syscall

move $a0,$t4

li $v0,1

syscall

exit:

# Otherwise, end the program

li $v0, 10 # Service 10 = exit or end program

syscall

############################ subroutine - convert2lower #################################

convert2lower: # Converts a character(stored in $a0) to

# its lower case, if it is upper case

# and store the result(lower case) in $v0

move $v0,$a0

blt $a0,'A',return

bgt $a0,'Z',return

subi $v0,$a0,-32

return: jr $ra # Return the converted(lower case) character

############################## subroutine - convert2upper ##################################

convert2upper: # Converts a character(stored in $a0) to

# its upper case, if it is lower case

# and store the result(upper case) in $v0

move $v0,$a0

blt $a0,'a',return2

bgt $a0,'z',return2

addiu $v0,$a0,-32

return2: jr $ra # Return the converted(lower case) character

4 0
3 years ago
10
Nataly_w [17]

Ok so I don't know what your text is about so you'll have to figure that out your self

Scientists track these measurements to make a final model because using the research data from the previous model can show the grows and glows of that model. Using this data scientists can improve whats needed.

7 0
2 years ago
Other questions:
  • Which of the following is not a good way to conserve fuel and reduce emissions?
    13·2 answers
  • The different concepts in the architecture operating model are aligned with how the business chooses to integrate and standardiz
    10·2 answers
  • Which of the following lists contains the five essential elements of a computer?
    5·1 answer
  • "A switch passes data based on the MAC address."A. TrueB. False
    15·1 answer
  • VURULU<br> The default style in Word is called the
    6·1 answer
  • Filtering data in Excel Online keeps all data on the screen and highlights the content that fits your criteria.
    9·1 answer
  • What is the output of the following program?
    11·2 answers
  • A digital presence created online by an individual or organization using a digital device is called a identity.
    7·1 answer
  • What can relaxation help to reduce?
    14·1 answer
  • (python) Given the formula for conversion from Celsius to Fahrenheit
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!