= Y :- V = U R - M D = L K J G E B LD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV z ORTSG YFOY? ILMV, GSZG'H z SZIWDZIV KILYOVN UTPUT should generate a file named out.txt ntents of out txt : dessage Num: 1 Coded Message LD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV Z ORTSG YFOY? pecoded Message OW MANY PROGRAMMERS DOES IT TAKE TO CHANGE A LIGHT BULB? dessage Num: 2 Coded Message ILMV, GSZG'H Z SZIWDZIV KILYOVN Decoded Message ONE, THAT'S A HARDWARE PROBLEM ease note in your output file print a newline (outToFile<

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
A - Z
B = Y
C = X
D = W
E - V
F = U
G = T
H = S
I = R
J = Q
K = P
L = 0
M = N
N - M
O = L
P = K
Q = J
O 3D
R - I
S = H
T = G
U = F
V - E
W - D
X = C
Y = B
Z - A
SLD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV Z ORTSG YFOY?
MLMV, GSZG'H Z SZIWDZIV KILYOVN
OUTPUT
It should generate a file named out.txt
Contents of out.txt:
Message Num: 1
Coded Message
SLD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV Z ORTSG YFOY?
Decoded Message
HOW MANY PROGRAMMERS DOES IT TAKE TO CHANGE A LIGHT BULB?
Message Num: 2
Coded Message
MLMV, GSZG'H Z SZIWDZIV KILYOVN
Decoded Message
NONE, THAT'S A HARDWARE PROBLEM
Please note in your output file print a newline (outToFile<<endl;) at the end of the output in the output file. Zybooks will look for a
newline printed in the file at the end of output file.
Please note: There are a total of 10 test cases. You have been provided with 5 test cases that are available to you and you can test your
code against the 5 test cases. The other 5 test cases are not available to you that we will use to test your code.
You need to follow the following naming methodology otherwise test case will fail.
For test case 1, input file should be named inputl.txt and output file should be named out.txt
For test case 2, input file should be named input2.txt and output file should be named out.txt
For test case 3, input file should be named input3.txt and output file should be named out.txt
Transcribed Image Text:A - Z B = Y C = X D = W E - V F = U G = T H = S I = R J = Q K = P L = 0 M = N N - M O = L P = K Q = J O 3D R - I S = H T = G U = F V - E W - D X = C Y = B Z - A SLD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV Z ORTSG YFOY? MLMV, GSZG'H Z SZIWDZIV KILYOVN OUTPUT It should generate a file named out.txt Contents of out.txt: Message Num: 1 Coded Message SLD NZMB KILTIZNNVIH WLVH RG GZPV GL XSZMTV Z ORTSG YFOY? Decoded Message HOW MANY PROGRAMMERS DOES IT TAKE TO CHANGE A LIGHT BULB? Message Num: 2 Coded Message MLMV, GSZG'H Z SZIWDZIV KILYOVN Decoded Message NONE, THAT'S A HARDWARE PROBLEM Please note in your output file print a newline (outToFile<<endl;) at the end of the output in the output file. Zybooks will look for a newline printed in the file at the end of output file. Please note: There are a total of 10 test cases. You have been provided with 5 test cases that are available to you and you can test your code against the 5 test cases. The other 5 test cases are not available to you that we will use to test your code. You need to follow the following naming methodology otherwise test case will fail. For test case 1, input file should be named inputl.txt and output file should be named out.txt For test case 2, input file should be named input2.txt and output file should be named out.txt For test case 3, input file should be named input3.txt and output file should be named out.txt
cosC 1430: File I/0 and Structs
1- Purpose
The assignment covers file I/0 and Structs.
Due: in Zybooks on Wednesday, June, 27 at 11:59 PM
2 - Problem
You will be provided with an input file that has a series of encoded messages. You will need to read in the file and decode the messages.
You must check to make sure that the input file has been opened.
The first 26 lines of the input file will tell you what each coded letter should equal. For example: 'A = Z' means that for every A in a coded
message, it should be replaced with a Z. You should store this information in an aray for easy decoding. This set of information will always
be presented A through Z so that you may assign an array position to a letter, i.e., index 0 will always be A.
The next number in the file will be the number of coded messages that will be contained in the file. This number should be used to make
array of the structs (i.e., the number is the size of the array).
You will need to create a struct that contains an integer type of variable that keeps track of which message number is contained in the
struct, and two strings, the coded message and the decoded message.
struct messages {
int messageNum;
string codedMessage;
string decodedMessage;
} ;
Then, using the getline function, you should read in a whole line of the file at a time and store it in the appropriate struct location (i.e., the
string member variable of the struct used to store the coded message). You will then decode the message and store it in the appropriate
struct location. A function is recommended for decoding, but not required.
Once all the messages are decoded, you should go over the array of struct and print each element with its corresponding message
number, the coded message, and the decoded message, to the file out.txt
3 - Example Input and Output
You have been provided with 5 input files for each test case in Black board(BB) and a sample output file too. BB consist of 5 input files
namely input1.txt for test case 1, input2.txt for test case 2, input3.txt for test case 3, input4.txt for test case 4, input5.txt for test case 5.
You need to provide input file name in zybooks, for example : input1.txt
Contents of input1.txt
Transcribed Image Text:cosC 1430: File I/0 and Structs 1- Purpose The assignment covers file I/0 and Structs. Due: in Zybooks on Wednesday, June, 27 at 11:59 PM 2 - Problem You will be provided with an input file that has a series of encoded messages. You will need to read in the file and decode the messages. You must check to make sure that the input file has been opened. The first 26 lines of the input file will tell you what each coded letter should equal. For example: 'A = Z' means that for every A in a coded message, it should be replaced with a Z. You should store this information in an aray for easy decoding. This set of information will always be presented A through Z so that you may assign an array position to a letter, i.e., index 0 will always be A. The next number in the file will be the number of coded messages that will be contained in the file. This number should be used to make array of the structs (i.e., the number is the size of the array). You will need to create a struct that contains an integer type of variable that keeps track of which message number is contained in the struct, and two strings, the coded message and the decoded message. struct messages { int messageNum; string codedMessage; string decodedMessage; } ; Then, using the getline function, you should read in a whole line of the file at a time and store it in the appropriate struct location (i.e., the string member variable of the struct used to store the coded message). You will then decode the message and store it in the appropriate struct location. A function is recommended for decoding, but not required. Once all the messages are decoded, you should go over the array of struct and print each element with its corresponding message number, the coded message, and the decoded message, to the file out.txt 3 - Example Input and Output You have been provided with 5 input files for each test case in Black board(BB) and a sample output file too. BB consist of 5 input files namely input1.txt for test case 1, input2.txt for test case 2, input3.txt for test case 3, input4.txt for test case 4, input5.txt for test case 5. You need to provide input file name in zybooks, for example : input1.txt Contents of input1.txt
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY