Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA LANGUAGE!!!!!! Sharyland high school boys decided to go on a field trip for two nights and three days. There are three types of rooms

JAVA LANGUAGE!!!!!!

Sharyland high school boys decided to go on a field trip for two nights and three days. There are three types of rooms in the hotel where students can stay. The capacity of the room (the number of beds in the room) are given, and it is assumed that the number of rooms are unlimited. The students are assigned to these rooms, but we do not want to have any empty beds in all assigned rooms. For example, if there are three types (capacity) of the room are five (type1), nine(type2), or twelve(type3), and the entire student is 113, you can book four type1, five type2, and four type3 rooms without a bed in each room. However, if the room types are like three, six, and nine for type 1, 2, and 3 respectively, and the whole student is 112, it is impossible to assign a room without an empty bed. Write a program that determines if room assignments are possible so that there are no empty beds in all assigned rooms when there are three numbers representing the capacity of the three types of room and one number representing the total number of students. It is allowed to use only one type or two types of rooms without using all three types of rooms. Input and output should be through a text file. The file name should be input.txt and output.txt Input file & Output file Format A = capacity of room type 1 B = capacity of room type 2 C = capacity of room type 3 N = Total number of students T = number of test case S = 1 or 0 Input file

A B C N

A B C N

.

.

. Output file

S

S

.

.

. Example Input file

5 9 12 113

3 6 9 112 Output file

1

0

for full points make it clear!! DO NOT COPY OFF OTHER CHEGG CODES, DO YOUR OWN

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

Why does the BOP always balance?

Answered: 1 week ago

Question

Discuss the objectives of discipline and appeals systems

Answered: 1 week ago