Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program C + + you will analyze the results of some ghost hunts. You will read data from ghosts.txt ( a sample is

In this program C++ you will analyze the results of some ghost hunts. You will read data from ghosts.txt (a sample is provided in the starter code). The file contains evidence collected during a recent ghost hunt. There will be three events in a file, 1 per line. Each line will have the event code and the number of times that event occurred. As you read in the event, you will need to calculate an overall haunting score for the ghost hunt. If the haunting score is greater than 15, then you should display the message "This place is haunted." Otherwise, the program should display "This place is probably not haunted." Before the program finishes, you should print the message "Great job! On to the next one."
The possible events and the number of points each occurrence is worth are summarized in the table below.
Ghost Hunting Events
Event Event Code Points
EVP (Electronic Voice Phenomena) E 3
Shadows or Orbs S 1
Footsteps F 2
Full Body Apparition A 5
Objects moving on own O 5
Doors shutting on own D 3
ThermoCamera hot or cold spots T 2
Sample Output
Analyzing Ghost Hunt Data ...
Found 7 instances of shadows or orbs.
Found 1 instances of a full body apparition.
Found 3 instances of doors shutting on their own.
The haunting score for this place is 21.
This place is haunted.
Great job! On to the next one.
Analyzing Ghost Hunt Data ...
Found 2 instances of EVP (Electronic Voice Phenomena).
Found 2 instances of footsteps.
Found 1 instances of objects moving on their own.
The haunting score for this place is 15.
This place is probably not haunted.
Great job! On to the next one.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Were the right people involved in the decision-making process?

Answered: 1 week ago

Question

Were they made on a timely basis?

Answered: 1 week ago