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
What is the Difference between CUI and GUI
Fynjy0 [20]

Hi there!


GUI Means Graphical user interface


CUI means  Controlled Unclassified Information


Theres the difference they are completely different from each other.


PLEASE MARK BRAINLIEST

-WeasuLL

7 0
3 years ago
Read 2 more answers
How much power is consumed by a 1.4A motor connected to a 12V battery?​
AleksAgata [21]

Capacity

A battery's capacity determines roughly how long a battery will last at a specific voltage given a specific discharge rate. For example, if you choose a 12V, 2Ah (2000mAh) battery pack (regardless of chemistry), the battery should be able to run a 12V motor consuming 2A continuously for 1 hour. Alternatively, it can run a 12V motor consuming 1A for 2 hours, or a 12V motor consuming 0.5A for 4 hours. The rule of thumb is to divide the capacity (assuming you are running an actuator at the same voltage) by the actuator's current under normal load to get the time the motor will last.

8 0
3 years ago
Draw the 2-3 tree that results when you insert the keys E A S Y Q U T I O N in that order into an initially empty tree
mr_godi [17]

Answer:

If its any easy question, answer it yourself.

Explanation:

:)

6 0
3 years ago
Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)
sergiy2304 [10]

Answer:

def countup():

pass

def countdown():

pass

x = int(input("Choose a number: "))

if x >= 0:

countup()

if x < 0:

countdown()

Explanation:

I start by getting a user input which is saved to variable called "x." I then make if statements to see whether is greater than, equal to, or less than 0. After that, I call the functions.

3 0
3 years ago
What is the full form of ICT?​
dalvyx [7]
Information and communications technology
3 0
3 years ago
Read 2 more answers
Other questions:
  • What is a common method for testing a spot weld?
    13·1 answer
  • What type of multimedia is a game CD? Game CDs are examples of ___ multimedia.
    15·2 answers
  • Consider the following arrays. 1 4 21 2 4 100 B # 111(A) L3π 42 Write MATLAB expressions to do the tollowing a. Select just the
    13·1 answer
  • An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Ove
    13·1 answer
  • ______ is data that is entered into a computer. ______ is the result produced by a computer.
    6·1 answer
  • You need to transmit PII via email and you want to maintain its confidentiality. Which of the following choices is the BEST solu
    8·1 answer
  • 52. Which of the following numbering system is used by the computer to display numbers? A. Binary B. Octal C. Decimal D. Hexadec
    12·2 answers
  • What best describes the computer's BIOS (basic input-output system)?
    5·1 answer
  • Catherine is designing the backup strategy for the new private cloud that her company is implementing. She specifies that a full
    13·1 answer
  • A form of encryption that uses only one key to encrypt and decrypt a file. This is a less
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!