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

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

Step: 3

blur-text-image

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago

Question

4. Make recommendations on steps to take to melt the glass ceiling.

Answered: 1 week ago