c++

In today’s fast-paced academic environment, students often find themselves juggling multiple responsibilities, from attending classes and working part-time jobs to participating in extracurricular activities. The demands of modern education can be overwhelming, leaving students in search of effective solutions to manage their academic workload efficiently. One such solution is the use of Nursingpapertutors.com academic writing website. Nursingpapertutors.com academic writing website employ a cadre of experienced and knowledgeable writers who are well-versed in various academic subjects and writing styles. Nursingpapertutors.com professionals bring a wealth of expertise to the table, enabling them to produce well-researched and well-structured papers that meet the academic standards and expectations of students. Their familiarity with diverse subjects ensures that students can receive assistance across a wide spectrum of disciplines, from mathematics to literature, and from nursing to engineering.

 

Cylon says what?!?!?! Part 1

Admiral Adama needs to decrypt a series of messages from his various lookout pilots. He’s hoping that one of them will let him know the position of the Cylon fleet. Because of his standing order, computers cannot be networked together, so to decrypt the message it will have to be run through 3 separate programs run on 3 different computers. 

Adama feeds the encrypted file into the first computer, and it immediately spits out a new file.  Looking at it he can see that it’s starting to decrypt the file.

He then feeds this new file into the second computer, and it immediately spits out a second new file. Looking at this file he can see that the file is almost readable, but still needs to go through the next stage.

Finally, Adama  feeds the file to the last computer.  It immediately spits out the final decrypted file and sees that one of his pilots has indeed found the Cylon fleet. 

Decryption

For this project you will be writing 3 programs. Each program will contain a main and 1 function that will do the decrypting. 

Decryption stage 1:

You will be given the initial file to decrypt. It will be named “messages.txt”. You will read the sentence into a string.

You will send the string to a function you write named “reverse_sentence”:

string reverse_sentence(string s);

This function will reverse the string, and then return the reversed string. Do not make a new string, save it back into the original string.

You must use one of the STL algorithms.

Next you will write the string to a new file called “stage2.txt”.

Decryption stage 2:

The structure of this program is similar to  stage 1; you will open the file “stage2.txt” and read the sentence into a string.

You will send the string to a function you write named “normalize_sentence”:

string normalize_sentence(string s);

This function will down case all letters of the string, and then up case only the first character of the string.  It will then return the modified string.

You must use one of the STL algorithms.

Once you have normalized the string you will then write it out to a new file called “stage3.txt”. 

Decryption stage 3:

The structure of this program is similar to  stage 2; you will open the file “stage3.txt” and read the sentence into a string.

You will send the string to a function called “replace_sentence”:

string replace_sentence(string s);

This function will replace certain words in the string with other words.  You will then return the modified string.

You must use string functions.

YOU MUST USE A SERIES OF IF-STATEMENTS. DO NOT USE A SWITCH-STATEMENT IN THIS FUNCTION!!!

Here are the words that need to be replaced. There may be multiple words that need to be replaced in a string, but the replacement word will only appear once.

1Replace “barn” with “Galactica

2Replace “toaster” with “Cylon

3Replace “juice” with “fuel

4Replace “wagon” with “viper

You must replace the entire string if you find these phrases

After you finish write out the string to a new file named “decrypted.txt”. 

 

Additional Things!!

•In each program you must read in the entire file into the string before you can start using your decryption function. 

•You must close the files your reading from and writing to before the end of each program.

•You can use cin/cout for testing, but remove or comment out the lines before turning in the program.

 

IMPORTANT HINTS!!!!

You can find the functions required in the standard template library. You can see the library on http://www.cplusplus.com under the reference section.

Do some experimentation. Write small test programs to test out functions before you build the full programs.

 

A messages.txt file is provided

 

Objectives:

•practice declaring C++ variables with appropriate names and data types

•practice console I/O

•practice using C++ arithmetic operators

•practice using boolean expressions in flow-of-control statements

•learn and practice the strategy of incremental development

Requirements:

•your program source code must be documented correctly (see the starter.cpp example) 

•your program source code must be neatly and consistently formatted (see the starter.cpp example) 

•your programs must compile and run without errors 

•your programs must successfully read from and write to text files 

                  reverse_sentence function implemented correctly 

•                     normalize_sentence function implemented correctly  

•                     replace_sentence function implemented correctly 

 

                   NOTE: Start small and get it working before you move on to a new feature. You have to follow the requirements to get credit

 

One of the significant challenges students face is time management. The demands of coursework, assignments, and exams can create immense pressure, leading to stress and a potential drop in academic performance. Nursingpapertutors.com academic writing website can be a valuable resource for students seeking to balance their responsibilities effectively. By outsourcing some of their academic tasks, students can free up time to focus on studying, participating in meaningful extracurricular activities, or even addressing personal obligations. This improved time management can alleviate the stress associated with academic overload. The ultimate goal of education is to enhance one’s knowledge and skills. Nursingpapertutors.com academic writing websites can play a vital role in achieving this goal by providing students with well-crafted papers that serve as models for their own work. These papers can offer valuable insights into effective research, organization, and writing, thereby empowering students to improve their academic performance over time.

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.