Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Professor Potter has left a secret message, of unknown length, encoded in file msg.dat for you to unravel. The setup is simple: each line of

Professor Potter has left a secret message, of unknown length, encoded in file msg.dat

for you to unravel. The setup is simple: each line of the file contains one char and one nonnegative integer. The key to reading the message is organizing the characters in the proper order. The integer indicates the position of the character within the message. For example:

e 2

b 1

a 3

h 5

c 4

spells 'beach' when unraveled.

In C++, using a linked list , write a program that will:

1) ask the user for the name of a file, opening and reading this file exactly once

2) unravel and display the message

3) offer to do it again on another file

Notes:

You should check to see that the file exists and contains some data. While debugging your program you may wish to use a shorter file. Also note that some of the characters in the message will be blank spaces or punctuation.

msg.dat file:

image text in transcribed

3355080183652358541221341 97905693 27 9640012 464 3539234134141 1 5332 2 3 3 1 1 41122 434. 1 4 2 0 4 3 2 4 5 5 15 258 t'. u sn enrc dotoo ,naoh.1 emplo egtom_wYtsae y tmhosge 3355080183652358541221341 97905693 27 9640012 464 3539234134141 1 5332 2 3 3 1 1 41122 434. 1 4 2 0 4 3 2 4 5 5 15 258 t'. u sn enrc dotoo ,naoh.1 emplo egtom_wYtsae y tmhosge

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago