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 }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 3GZ
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage