Read floating-point numbers from input until a floating-point number is read that is not in the range -45.0 to 15.0, both exclusive. For each floating-point number read that is in the given range, output the floating-point number followed by " is accepted". Then, output the floating-point number read that causes the reading to stop followed by " is rejected". End each output with a newline. Ex: If the input is -41.6 -37.8 -35.5 -38.4 -42.3 -49.5 -36.9 -41.1, then the output is:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 29PE
icon
Related questions
icon
Concept explainers
Question
Read floating-point numbers from input until a floating-point number is read that is not in the range -45.0 to 15.0, both exclusive.
For each floating-point number read that is in the given range, output the floating-point number followed by " is accepted". Then,
output the floating-point number read that causes the reading to stop followed by " is rejected". End each output with a newline.
Ex: If the input is -41.6 -37.8 -35.5 -38.4 -42.3 -49.5 -36.9 -41.1, then the output is:
-41.6 is accepted
-37.8 is accepted
-35.5 is accepted
-38.4 is accepted
-42.3 is accepted
-49.5 is rejected
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5
167899
10}
double dataValue;
/* Your code goes here */
return 0;
Transcribed Image Text:Read floating-point numbers from input until a floating-point number is read that is not in the range -45.0 to 15.0, both exclusive. For each floating-point number read that is in the given range, output the floating-point number followed by " is accepted". Then, output the floating-point number read that causes the reading to stop followed by " is rejected". End each output with a newline. Ex: If the input is -41.6 -37.8 -35.5 -38.4 -42.3 -49.5 -36.9 -41.1, then the output is: -41.6 is accepted -37.8 is accepted -35.5 is accepted -38.4 is accepted -42.3 is accepted -49.5 is rejected 1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 167899 10} double dataValue; /* Your code goes here */ return 0;
Expert Solution
Step 1 Summary

I have provided  C++  CODE  along  with CODE  SCREENSHOT  and  OUTPUT  SCREENSHOT----------------------------

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning