Question: debug everything in the code The Debugging Game This program presents the user with a random selection and asks Iwhether or not it is a

debug everything in the code debug everything in the code The Debugging Game This program presents the

The Debugging Game This program presents the user with a random selection and asks Iwhether or not it is a "bug" fprintf(' Welcome to The Debugging Game ') Initialize the array of test items. Each row has two strings the name of San item and a 0 or 1 indicating whether it counts as a bug. testvalues - ["spider" "1"; "bumblebee' "1";'slipper lobster" "1";'viretap" "1" labradoodle" "0"; "glitch" "1"; "pillbug" "1":"ww Beetle" "1","Union label" "wasp" "1"; "Gronkovski" "0","feature" "0"); Select a random row of the array [r, c]-size(testvalues); selectrovrand (1,1); teatelement-testvalues (selectrow, 1); Find the second entry in the selected row and convert it from a string to a Snumber that can be used for logical testa testansver-str2double(testvalues (selectrow, 2)); Ask the user whether the element is a bug fprintf(' is a ta a bug? ' testelement) Scompare response to correct ansver response-input('Enter y for yes, a for not,''); if response ('y 'Y') i testanswer fprintf("Good catch! A is is a bug! ', testelement) else fprintf('Sorry, a to isn't a bug. ', testelement) ond olsest responsom'n'IN) if testanswer {printf('Actually, a to IS a bugi ', teatelement) fprintf('You're right! A is is NOT a bugi ', testelement) olae fprintf('I didn't understand your answer. ' end ond

Step by Step Solution

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 Databases Questions!