Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# How to Program

Authors: Paul J. Deitel, Harvey Deitel

6th edition

134601548, 134601793, 978-0134601540

More Books

Students also viewed these Electrical Engineering questions

Question

To what extent is the information reliable and valid?

Answered: 1 week ago

Question

What do you think?

Answered: 1 week ago