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]
3 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]3 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
A Python function cannot under normal circumstances reference a module variable for its value.
marishachu [46]
This is false because
6 0
3 years ago
Read 2 more answers
If a preferred (faster) learned route over a WAN has administrative distance 110 that competes with a static backup (slower) rou
almond37 [142]

The engineer will need to set the distance to 130 for the static link so that it becomes a floating static route.

<h3>What is Floating static routes?</h3>

This is known to be a static routes that is said to have a kind of administrative distance that is also known to be bigger than the administrative distance of any other static route or dynamic routes.

Note that the value 130 stands for the next most logical value, nd as such it is to know that the right route comes first in the steps for administrative distance.

Learn more about WAN from

brainly.com/question/11352260

5 0
2 years ago
ou are working as a technician on a computer loaded with MS Windows. You boot the computer that has an incorrect driver loaded f
jeka94

Answer:

My Computer>>Properties>>Device Manager>>Video Card Properties>>Drivers Tab>>Roll Back Driver.

Explanation:

The user can do so by reverting the driver to the previous  version, The correct process to do so is by the Right Clicking on the computer menu and clicking device manager from the properties. In the device manager, click the properties of the video card and select the Drivers tab. In the Drivers tab, click on the Roll Back Driver. This will restore to the previous driver.

7 0
3 years ago
Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
dsp73
# Written in python

a = int(input("Enter an integer: "))
b = int(input("Enter an integer: "))

sum = a + b

# subtract the smaller number from the bigger
if a < b:
    dif = a - b
else:
    dif = b - a

prod = a * b

print("The sum is", sum)
print("The dif is", dif)
print("The product is", prod)
6 0
3 years ago
HELP PLLISSSSSSSSSS!!!!!!!!!! its unit test will mark as brainliest
astraxan [27]

Answer:

1. file

2. true:false

3. prioitized

4. drafts

Explanation:

8 0
3 years ago
Other questions:
  • The information security organization performs a significant role in the implementation of solutions that mitigate risk and cont
    6·1 answer
  • How to search multiple microsoft word documents?
    15·1 answer
  • IT professionals recognize that successful systems must be user-oriented, and users need to be involved, formally or informally,
    11·1 answer
  • How many data bits are sent in a single psk31 character?
    15·1 answer
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • When you start a new blank document, you begin typing at the
    6·1 answer
  • The metric unit used for length
    5·1 answer
  • Need answer ASAP
    8·2 answers
  • Please answer quickly :S
    7·2 answers
  • Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!