Ethan H.

asked • 03/17/21

Strings Lab 3 questions

 Separate the 4 programs with blank lines to make it more readable and label each problem such 1,2,3,4. I dont need extensive comments only the header section.

Each problem is worth 10 points.  

 

Strings_Lab:_3

  1. Write a list that contains 10 fruits(no duplicate fruits). Loop through the list and print out the length of each fruit in the list. The output should be formatted as the example below with the titles and the values.

Fruit                    Length

Apples                6

Bananas              7

 

  1. Create a menu that the user can pick from the following options, Temperature Conversion, Mortgage Payment and Exit. The menu should be designed so that if a wrong option is picked a statement will be presented to the user and the menu will be displayed again for the user to enter a valid option.

 

 3. The following string contains numbers, letters and special characters. Print out the number of letters, numbers and special characters(does not include spaces) in the      string.

      mystring = “Today is March 17th, 2021 also formatted as 03/17/2021 and in Europe it is 17/03/2021”

              example given of output format:

              Type                                  numbers

             letters                                10

             numbers                            11

              Special characters           4

 

  1. The following strings contains lots of words. Determine how many words are in the string along with the total length of all words in the string.

 mystring = “The sun was rising then it wasn’t, darkness was all around until I saw the light and all was well”


Patrick B.

exactly the same as ANDREW K. yesterday
Report

03/17/21

1 Expert Answer

By:

Patrick B. answered • 03/17/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.