Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program Three cats named A, B and C and two mice are standing at some points on a line. Cats A and B are

C++ program image text in transcribed
Three cats named A, B and C and two mice are standing at some points on a line. Cats A and B are standing at point x and cat C is standing at point y. The to mice are hiding at a point The cats run at the same speed, and they want to catch one of the two mice. If cats A and B arrive at point z first, each cat catches one mouse. If cat C arrives first at point z it catches one of the mice and the other one escapes; cats A and B cateh none. If all cats arrive at the same time, they fight and the two mice escape. You are given a number of test cases in the form of x. I, and z cat catches Find the number of mice each Input Format The first line contains a single integer T denoting the number of test cases A's location), y (cat B's location), and z (location of the two mice) on the line. .Each of the subsequent T lines contains three space-separated integers describing a (cat Output Format Sample Output Cat A: 1 Cat B: 1 Cat C:1 Sample Input 12 3 132 Instructions Write and run a C++ back of this sheet: program to solve the problem using the input data below. Prouide on the (a) the C++ program, and (2) the output. Show your complete code and output on the back page. Demonstration of the program Input data 22 75 70 33 86 59 47 29 89 18 19 82 84 17 18 84 68 76

Step by Step Solution

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

More Books

Students also viewed these Databases questions

Question

Give in to the opinion of group members just to avoid conflict.

Answered: 1 week ago

Question

Using Language That Works

Answered: 1 week ago

Question

4. Are my sources relevant?

Answered: 1 week ago