Using C++ Language Use cout statements to display a 3-dimensional figure of the cube (consider using the characters “-\|/_”) when the program starts up to show the numbering of the corners. The cube corners are labeled from 0 to 7 with 0 starting at the upper left-hand corner of the front face of the cube proceeding clockwise with corners 0, 1, 2, and 3 on the front face, and corner 4 being the upper left-hand corner of the rear face and proceeding clockwise with corners 4, 5, 6, and 7 on the rear face. (Note that computer scientists generally start counting at zero, rather than one, as the math calculations work out better. This will make more sense once we study 2 dimensional arrays.) You will need a delay function to slow down your code so the user can see Herman moving around the cube. You might want to get the following code working in a separate test project and then figure out how to use it in your Herman solution (see below) For each simulation, use cout statements to display the initial corner Herman is randomly placed upon, and the location of the randomly placed poison; use the build in rand function to generate a random integer between 0 and 7. Then using a single output line and a .25 second delay, use cout statements to indicate the corners Herman visits until inevitably reaching the corner with the poison. Then display the total number of corners visited by Herman in that trial and a running average of the number of corners Herman reached in all trials since the program with initiated. When 10 trials have occurred, display Herman The Fly’s expected value. You will need to call or invoke four built-in functions (ctime, srand, rand, sleep_for) and write and invoke at least 7 functions you write yourself as indicated in the structure chart provided below. You must at least create and use these functions to implement your Herman the Fly simulation. While your final solution needs to use srand and ctime to generate a random start seed, I suggest using a fixed seed to run your simulations during implementation, so you have consistent results during debugging.

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
  1. Using C++ Language
  2. Use cout statements to display a 3-dimensional figure of the cube (consider using the characters “-\|/_”) when the program starts up to show the numbering of the corners. The cube corners are labeled from 0 to 7 with 0 starting at the upper left-hand corner of the front face of the cube proceeding clockwise with corners 0, 1, 2, and 3 on the front face, and corner 4 being the upper left-hand corner of the rear face and proceeding clockwise with corners 4, 5, 6, and 7 on the rear face. (Note that computer scientists generally start counting at zero, rather than one, as the math calculations work out better. This will make more sense once we study 2 dimensional arrays.)

You will need a delay function to slow down your code so the user can see Herman moving around the cube. You might want to get the following code working in a separate test project and then figure out how to use it in your Herman solution (see below)

For each simulation, use cout statements to display the initial corner Herman is randomly placed upon, and the location of the randomly placed poison; use the build in rand function to generate a random integer between 0 and 7. Then using a single output line and a .25 second delay, use cout statements to indicate the corners Herman visits until inevitably reaching the corner with the poison. Then display the total number of corners visited by Herman in that trial and a running average of the number of corners Herman reached in all trials since the program with initiated. When 10 trials have occurred, display Herman The Fly’s expected value.

  1. You will need to call or invoke four built-in functions (ctime, srand, rand, sleep_for) and write and invoke at least 7 functions you write yourself as indicated in the structure chart provided below. You must at least create and use these functions to implement your Herman the Fly simulation. While your final solution needs to use srand and ctime to generate a random start seed, I suggest using a fixed seed to run your simulations during implementation, so you have consistent results during debugging.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
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