A robot sits in a 30 foot square room. It be directed to travel a randomly generated distance between 8 and 20 feet. The user will input a value that will serve as the seed for the random number generator. Every foot it travels it indicates that it has traveled 'x feet'. Upon arrival at the user specified distance, it announces."| made it!"(This will happen even if the robot moves 0 feet). The program should also indicate how many more feet the robot could travel before running into a wall assuming it always starts at one wall of the room. Note that grammar used to indicate singular versus plural distances. i.e. for an random generation of 5, the resulting output should be: How far should the robot travel? 5 feet 2 feet 3 feet 4 feet 5 feet 1 foot I made it! I can only travel 25 more feet. tabs are used to space the output of traveled feet 30492.1753326.qu3zay? LAB АCTIVITY main.cpp 1 #include 2 using namespace std; 4 int main() { int roomsize - 30; int distance - 0; 8 cout « "How far should the robot travel? "; 1e 11 cout « distance « * feet" « end1; /* Type your code here. */ 12 13 return 0; 14 }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
A robot sits in a 30 foot square room. It be directed to travel a randomly generated distance between 8 and 20
feet. The user will input a value that will serve as the seed for the random number generator. Every foot it
travels it indicates that it has traveled 'x feet'. Upon arrival at the user specified distance, it announces."
made it!"(This will happen even if the robot moves 0 feet). The program should also indicate how many more
feet the robot could travel before running into a wall assuming it always starts at one wall of the room. Note
that grammar used to indicate singular versus plural distances.
i.e. for an random generation of 5, the resulting output should be:
How far should the robot travel? 5 feet
1 foot
I made it!
I can only travel 25 mor
2 feet 3 feet
4 feet 5 feet
e feet.
tabs are used to space the output of traveled feet
330492.1753326.qx3zay7
LAB
АCTIVITY
main.cpp
1 #include <iostream>
2 using namespace std;
3
4 int main()
int roomsize - 30;
6
int distance
= 0;
7
8
cout <« "How far should the robot travel? ";
9
10
cout <« distance <«
feet" <« end1;
11
/* Type your code here. */
12
13
return 0;
14 }
Transcribed Image Text:A robot sits in a 30 foot square room. It be directed to travel a randomly generated distance between 8 and 20 feet. The user will input a value that will serve as the seed for the random number generator. Every foot it travels it indicates that it has traveled 'x feet'. Upon arrival at the user specified distance, it announces." made it!"(This will happen even if the robot moves 0 feet). The program should also indicate how many more feet the robot could travel before running into a wall assuming it always starts at one wall of the room. Note that grammar used to indicate singular versus plural distances. i.e. for an random generation of 5, the resulting output should be: How far should the robot travel? 5 feet 1 foot I made it! I can only travel 25 mor 2 feet 3 feet 4 feet 5 feet e feet. tabs are used to space the output of traveled feet 330492.1753326.qx3zay7 LAB АCTIVITY main.cpp 1 #include <iostream> 2 using namespace std; 3 4 int main() int roomsize - 30; 6 int distance = 0; 7 8 cout <« "How far should the robot travel? "; 9 10 cout <« distance <« feet" <« end1; 11 /* Type your code here. */ 12 13 return 0; 14 }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education