Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write in Java for me. Your computer lab often runs out of chairs to sit in during programming practices. In order to overcome this

Please write in Java for me.image text in transcribed

Your computer lab often runs out of chairs to sit in during programming practices. In order to overcome this hardship, the team borrows chairs from other adjacent rooms. Given the number of people who are coming to practice and the number of chairs in the room, how many more chairs must the team take from other rooms? Sometimes there are enough chairs to begin with. In this case, we need not take any more chairs to the room. Input The input will begin with a single line containing T, the number of test cases to follow. On each of the next T lines there will be two integers, N ( 1SN s 10) and M single space. N is the number of people coming to practice that day and M is the number of chairs already in the room that day (O s M), separated by a Output The output will consist of T lines, each containing a single number the number of additional chairs needed for that day. Sample Input Sample Output 2 10 9 15 8 7

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions