Question: in C++ coding three blocks of code. This block of code goesin middle_word_check . This block of codetakes a word from the user and sees

in C++ coding three blocks of code.

This block of code goesin middle_word_check. This block of codetakes a word from the user and sees if it comes before or after theword "middle" in the dictionary (lexicographical ordering)according to the ASCII table.

InputOutput
appleapple comes before middle
MiddleMiddle comes before middle
treetree comes after middle

second block of code goesin animal_abcs. It takes from input onecharacter. It outputs the name of an animal that starts with thecharacter. We will only process a-f and A-F. Any other characterwill produce an error. The lower case and capitol letters willproduce the same animal name in lower case. Try not to duplicatecode.

'a' or 'A'anteater
'b' or 'B'bat
'c' or 'C'caterpillar
'd' or 'D'dolphin
'e' or 'E'emu
'f' or 'F'frog
'T'T is not supported
'2'2 is not supported

  1. third block of code goesin delivery_range_check. An UberEatsdriver needs to see if they can make 2 deliveries in a 2 hourwindow, assuming they drive 45 mph on average. If they have to stopfor gas or charge its a no go. If the distance between all stops isless than 15 miles and they are driving a gas car, its moreeconomical for the driver to take an electric scooter. This blocktakes 5 inputs:
    1. and 4 distances,
      1. the driver's house to restaurant 1
      2. restaurant 1 to customer 1
      3. customer 1 to restaurant 2
      4. restaurant 2 to customer 2
    2. the number of miles the car can go on a tank/charge
    3. the car type, gas or electric

This block outputs whether or not the deliver can be made and ifit can what transportation the driver should use. For example,

InputOutput
electric 85 3.2 5 5.06 3You can do it with your electric car!
gas 240 12 3.5 4.3 20 5You can do it with your gas car!
electric 200 30 30 30 30Not going to happen.

Step by Step Solution

3.32 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!