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
A ______ is a computer that controls access to the hardware, software, and other resources on a network. mainframe server workst
kykrilka [37]
The answer is mainframe
4 0
2 years ago
Can anyone please help me out
Sidana [21]

Answer:

No se ve nada

3 0
2 years ago
WHAT IS MULTIMEDIA SUPPOSED TO MEAN ???
melisa1 [442]

Answer:

using more than one medium of expression or communication

3 0
2 years ago
Read 2 more answers
Create a new Die object. (Refer to Die.html for documentation.)Create a loop that will iterate at least 100 times. In the loop b
hjlf

Answer:

Java code is given below

Explanation:

import java.util.Random;

class Die{

private int sides;

public Die(){

sides = 6;

}

public Die(int s){

sides = s;

}

public int Roll(){

Random r = new Random();

return r.nextInt(6)+1;

}

}

class DieRoll{

public static void main(String[] args) {

Die die = new Die();

int arr[] = new int[6];

for(int i=0; i<6; i++)

arr[i] = 0;

for(int i=0; i<100; i++){

int r = die.Roll();

arr[r-1]++;

}

for(int i=0; i<6; i++)

System.out.println((i+1)+" was rolled "+arr[i]+" times.");

}

}

8 0
3 years ago
Live preview is available on a touch screen T/F
TEA [102]
<span>It is false that live preview is available on a touch screen. Life preview refers to cameras mostly, and to the fact that its display screen can be used as a viewfinder. Viewfinder is what you look through when you are using a camera to take a photo, or to focus on something. So, no, touch screen devices do not have this feature available, only the "old-school" cameras do.</span>
3 0
3 years ago
Other questions:
  • Tower defense is included under which genre of game
    15·2 answers
  • Reputable firms often ask recent graduates to pay an up-front fee for a job.
    12·2 answers
  • Suppose L is a LIST and p, q, and r are positions. As a function of n, the length of list L, determine how many times the functi
    8·1 answer
  • Which famous individuals was born on october 31st?
    7·1 answer
  • Using ________ as a promotion method will bring return visitors to your site.
    8·1 answer
  • PLEASE HURRY I WILL GIVE BRAILIEST TO WHO EVER ANSWERS AND IS CORRECT
    14·2 answers
  • Use Spreadsheet Functions and Formulas
    6·1 answer
  • Why do you need to put your phone on airplane mode.
    14·1 answer
  • What does playstation network is currently undergoing maintenance?.
    15·1 answer
  • What are some of the characteristics found in an editorial photograph?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!