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.
| Input | Output |
| apple | apple comes before middle |
| Middle | Middle comes before middle |
| tree | tree 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 |
- 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:
- and 4 distances,
- the driver's house to restaurant 1
- restaurant 1 to customer 1
- customer 1 to restaurant 2
- restaurant 2 to customer 2
- the number of miles the car can go on a tank/charge
- the car type, gas or electric
- and 4 distances,
This block outputs whether or not the deliver can be made and ifit can what transportation the driver should use. For example,
| Input | Output |
| electric 85 3.2 5 5.06 3 | You can do it with your electric car! |
| gas 240 12 3.5 4.3 20 5 | You can do it with your gas car! |
| electric 200 30 30 30 30 | Not going to happen. |
Step by Step Solution
3.32 Rating (149 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
