ONLY IF STATEMENTS ALLOWED!!!! NO RANGE FUNCTION, NO SETS, NO LISTS, NO LOOPS, ETC Angela loves reading books. She recently started reading an AI generated series called “Harry Trotter”. Angela is collecting books from the series at her nearest bookstore. Since the series is AI generated, the publishers have produced an infinite collection of the books where each book is identified by a unique integer. The bookstore has exactly one copy of each book. Angela wants to buy the books in the range [l,r], where l ≤ r. As an example, the range [−3,3] means that Angela wants to buy the books  − 3,  − 2,  − 1, 0, 1, 2, and 3. Dan also loves the series (or maybe annoying Angela – who knows, really), and he manages to sneak into the bookstore very early to buy all of the books in the range [d,u], where d ≤ u. When Angela later visits, sadly she will not find those books there anymore. For example, if Angela tries to buy books [−2,3] and Dan has bought books [0,2], Angela would only receive books  − 2,  − 1, and 3. The reading recommendation score of the books is the product of the book numbers received. So if Angela gets books  − 2,  − 1, and 3, for instance, the reading recommendation score will be  − 2 ×  − 1 × 3 = 6. Your task is to write a program that will help Angela determine whether the reading recommendation score of the books she receives is NEGATIVE, ZERO, POSITIVE, or EMPTY.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

ONLY IF STATEMENTS ALLOWED!!!!

NO RANGE FUNCTION, NO SETS, NO LISTS, NO LOOPS, ETC

Angela loves reading books. She recently started reading an AI generated series called “Harry Trotter”.

Angela is collecting books from the series at her nearest bookstore. Since the series is AI generated, the publishers have produced an infinite collection of the books where each book is identified by a unique integer. The bookstore has exactly one copy of each book.

Angela wants to buy the books in the range [l,r], where l ≤ r. As an example, the range [−3,3] means that Angela wants to buy the books  − 3,  − 2,  − 1, 0, 1, 2, and 3.

Dan also loves the series (or maybe annoying Angela – who knows, really), and he manages to sneak into the bookstore very early to buy all of the books in the range [d,u], where d ≤ u. When Angela later visits, sadly she will not find those books there anymore.

For example, if Angela tries to buy books [−2,3] and Dan has bought books [0,2], Angela would only receive books  − 2,  − 1, and 3.

The reading recommendation score of the books is the product of the book numbers received. So if Angela gets books  − 2,  − 1, and 3, for instance, the reading recommendation score will be  − 2 ×  − 1 × 3 = 6.

Your task is to write a program that will help Angela determine whether the reading recommendation score of the books she receives is NEGATIVE, ZERO, POSITIVE, or EMPTY.

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Lower bounds sorting algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr