Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE C PROGRAMMING LANGUAGE ONLY (#include ) Thank you You are given N data where each data consists of ID, name, and heigh in foot

USE C PROGRAMMING LANGUAGE ONLY (#include)

image text in transcribed

image text in transcribed

Thank you

You are given N data where each data consists of ID, name, and heigh in foot and inch. Then, there are M queries. For each query.given a variable x which represents a height in cm. You are asked for help to display all data whose height is less than or equal to x, ordered descending by the height. If there are 2 data which has the same height, sort ascending by the ID. If no data satisfies the query output"-1". Note that I foot = 12 inch, and 1 inch = 2,54 cm. Input Format The first line consists of an integer N. The next N lines consists of the given data in the format "A,B,CD" where A, B, C, and represent ID, name, height in feet, and height in inch, respectively. The next line consists of an integer M. The next M lines consist of an integer x which represents the query. Output Format Each query is started by "Q", followed by the query number started from 1, followed by*". For each query, if there is data to display, then output the data sorted descending based on the height with the following format: " ". If there is no data to display, output-1. Constraints 1SNMS 5 x 10 ID is an integer between 1 and N. It is guaranteed that 2 data will not have the same ID. Length of each name is between 1 and 20 (inclusive). Names consist of Latin alphabet or whitespace. It is guaranteed that the first and last character are not whitespaces. Height in foot is between 0 and 7 (inclusive). Height in inch is between 0 and 11 (inclusive). 1

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

describe factors of morale within the operation

Answered: 1 week ago

Question

Explain the factors influencing consumer behaviour.

Answered: 1 week ago