Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Now it\'s your turn. Write a function that identifies arachnids (the class of an

ID: 3814665 • Letter: N

Question

Now it's your turn. Write a function that identifies arachnids (the class of animals that contains the spiders) using the decision structure below You can name your function whatever you like, but you should name it something informative, such as classify_arachnid. Your function will consist of one giant if-elseif-else block, inside of which will be some nested if-else blocks The function should take no arguments, but should prompt the user for input The user should be asked no more than 5 questions, and should only be asked questions which are relevant to identifying the particular arachnid That is, if the user answers NO to question I, do not ask them question 2 Your function should return a string containing the name of the order to which the arachnid belongs Identifying Arachnids^6 1. Has a tail or a stinger? a YES, go to Question #2 b. NO, go to Question #3 2. Tail is straight like a needle? a. YES. Order Uropygi (whipscorpions) b NO, Order Scorpiones (scorpions) 3. Has claws? a. YES, go to Question #4 b NO, go to Question #5 4. Is less than 5mm long and is flat? a. YES, Order Pseudoscorpiones b. NO, Order Amblypygi (whipscorpions) 5. Has thin, stilt-like legs with high knees and a low body? a. YES, Order Opiliones (harvestmen) b. NO, go to Question #6 6. Body is oval-shaped and lacks a waist? a. YES, Order Acari (ticks and mites) b. NO, go to Question #7 7. Has 7 segments on each leg and the I^st pair are not longer than the rest? a. YES, Order Araneae (spiders) b. NO, Order Solifugae (windscorpions)

Explanation / Answer

PROGRAM

function animal = classify_arachnid
reply = input('Has a tail or a stinger: Y/N: ','s');
if (reply == 'N')
    reply = input('Has claws: Y/N: ','s');
    if (reply == 'Y')
        reply = input('Is less than 5mm long and is flat? Y/N:','s');
        if (reply == 'Y')
            disp('Name of Order: Pseudoscorpiones');
        else
            disp('Name of Order: Amblypygi (whipscorpians)');
        end
    else
        reply = input('Has thin, stil-like legs with high knees and a low body: Y/N: ','s');
        if (reply == 'Y')
            disp('Name of Order: Opiliones (harvestmen)');
        else
            reply = input('Body is oval-shaped and laccks a waist? Y/N:','s');
            if (reply == 'Y')
                disp('Name of order: Acari (ticks and mites)');
            else
                reply = input('Has 7 seghments on each leg and the 1st pair are not longer than the rest? Y/N','s');
                if(reply == 'Y')
                    disp('Name of Order: Araneae (Spiders)');
                else
                    disp('Name of Order: Solifugae(windscorpians)');
                end
            end
        end
    end
else
    reply = input('Tail is straight like needle: Y/N: ','s');
    if (reply == 'Y')
        disp('Namd of Order: Uropygi (whipscorpians)');
    else
        disp('Name of Order: Scorpions.');
    end
end
disp('    ');            
end

OUTPUT

Has a tail or a stinger: Y/N: Y
Tail is straight like needle: Y/N: Y
Namd of Order: Uropygi (whipscorpians)
  
Has a tail or a stinger: Y/N: Y
Tail is straight like needle: Y/N: N
Name of Order: Scorpions.
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: Y
Is less than 5mm long and is flat? Y/N:Y
Name of Order: Pseudoscorpiones
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: Y
Is less than 5mm long and is flat? Y/N:N
Name of Order: Amblypygi (whipscorpians)
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: N
Has thin, stil-like legs with high knees and a low body: Y/N: Y
Name of Order: Opiliones (harvestmen)
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: N
Has thin, stil-like legs with high knees and a low body: Y/N: N
Body is oval-shaped and laccks a waist? Y/N:Y
Name of order: Acari (ticks and mites)
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: N
Has thin, stil-like legs with high knees and a low body: Y/N: N
Body is oval-shaped and laccks a waist? Y/N:N
Has 7 seghments on each leg and the 1st pair are not longer than the rest? Y/NY
Name of Order: Araneae (Spiders)
  
Has a tail or a stinger: Y/N: N
Has claws: Y/N: N
Has thin, stil-like legs with high knees and a low body: Y/N: N
Body is oval-shaped and laccks a waist? Y/N:N
Has 7 seghments on each leg and the 1st pair are not longer than the rest? Y/NN
Name of Order: Solifugae(windscorpians)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote