1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stepan [7]
2 years ago
6

Sentence Deobfuscate Name this file deobfuscate.cpp Hints: Don’t overthink this problem. Prompt the user to enter a collection o

f sentence words (i.e., words in the sentence), with the spaces removed (i.e., the obfuscated sentence) and with words that are less than ten (10) letters each. Then prompt the user to enter a sequence of numbers that represent the length of each corresponding sentence word (i.e. the deobfuscated details). Output the deobfuscated sentence. Convert char c to int by subtracting 48 (‘0’) from c.
Sample Execution:
Please enter obfuscated sentence: Thisisasentence
Please enter deobfuscation details: 4218
Deobfuscated sentence: This is a sentence
Computers and Technology
1 answer:
nordsb [41]2 years ago
7 0

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   string text,lengt;

   cout<<"Please enter obfuscated sentence: ";    cin>>text;

   cout<<"Please enter deobfuscation details: ";    cin>>lengt;

   string t1, t2;

   int kount = 0;

   for(int i = 0;i<lengt.length();i++){

   kount+=(int)(lengt[i]-'0');

   t1 = text.substr(0, kount);

   t2 = text.substr(kount, text.length()-1);

   text = t1 +" "+ t2;

   kount++;   }

   cout<<"Deobfuscated sentence: "<<text;

   return 0; }

Explanation:

This declares the text and the deobfuscation details as string

   string text,lengt;

This prompts for the sentence

   cout<<"Please enter obfuscated sentence: ";     cin>>text;

This prompts for the details

   cout<<"Please enter deobfuscation details: ";     cin>>lengt;

t1 and t2 are declared as string. They are used to split the texts into 2 parts

   string t1, t2;

This declares and initializes a count variable to 0  

   int kount = 0;

This iterates through the deobfuscation details

for(int i = 0;i<lengt.length();i++){

This gets each deobfuscation character

   kount+=(int)(lengt[i]-'0');

The next two instructions splits the text into 2

This gets from 0 to kount.

   t1 = text.substr(0, kount);

This gets from kount to the last index

   t2 = text.substr(kount, text.length()-1);

The new string or sentence is calculated here

   text = t1 +" "+ t2;

The kount variable is incremented by 1

   kount++;   } The loop ends here

This prints the new sentence

   cout<<"Deobfuscated sentence: "<<text;

<em>See attachment for program file</em>

Download cpp
You might be interested in
On a leading-trailing system technician A says that both shoes do equal work when stopping while going in reverse. Technician B
sleet_krkn [62]

Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

<h3>How many brake shoes function?</h3>

There are known to be two shoes function that are said to be working a way where both become either the trailing shoe or leading shoe based on whether the vehicle is moving forward or backward.

Therefore we can say that, Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

Learn more about trailing system from

brainly.com/question/14367881

#SPJ1

5 0
1 year ago
What method do phishing and spoofing scammers use
Leya [2.2K]

Answer:

please give me brainlist and follow

Explanation:

There are various phishing techniques used by attackers:

Installing a Trojan via a malicious email attachment or ad which will allow the intruder to exploit loopholes and obtain sensitive information. Spoofing the sender address in an email to appear as a reputable source and request sensitive information.

8 0
2 years ago
What are the two ways to print a document?
guajiro [1.7K]

Answer:

ctrl+p or find the print button on the page

5 0
3 years ago
Match the cell reference to its definition
Alisiya [41]

Answer:

which cell reference:-|

6 0
3 years ago
Read 2 more answers
Is there an ethically acceptable reason to study and use the various attack methods described in this chapter? Can you think of
avanturin [10]

Answer:

Please see below  

Explanation:

Yes, there indeed is ethical justification for hacking certain computer systems. Since computer scientists are required to keep the system secure from external threats, so they make use of it when testing the network for potential loopholes that could make it vulnerable. It is beneficial in that it can help manifest the weaknesses present in the system, which can then be corrected for.

6 0
3 years ago
Other questions:
  • According to the article in WikiAnswers, digital communication systems have more benefits than analog systems. They are faster a
    10·2 answers
  • Despite its vivid design, the website for Lolly's Bookstore did not seem to attract customers who lingered. In fact, most websit
    13·1 answer
  • "The term ____ refers to the programs or instructions used to tell the computer hardware what to do."
    6·1 answer
  • Who is the person responsible for creating the original website content?
    14·1 answer
  • You are given two processors P1 and P2 that execute the same instruction set but have different architectures. The instructions
    9·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • What is output?
    13·1 answer
  • Question is on the picture thank you
    10·1 answer
  • This unintelligent brain of mine decided to charge my phone overnight thinking that nothing bad will happen ;-; the next morning
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!