Question
Need in pseudocode
Program 2: POWIN3D. In the early 80s, hackers used to write in an obfuscated, but mostly readable way called leet - short f
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Pseudocode:

1. take a map with character and string and store the all characters along with corresponding string (leet characters);

2. take input string 's' from console;

3. declare a empty string 'temp' ;

4. call the function temp = translateToL337(string s);

// inside the function

for( i=0 to s.length() )

replace all character of string 's' to temp with map value;

temp += m[s[i]];

5. output the temp to the console;

Source Code:

#include <bits/stdc++.h>
using namespace std;

string translateToL337(string s)
{
map<char,string>mp;
  
mp['a']="4";
mp['b']="B";
mp['c']="(";
mp['d']="D";
mp['e']="3";
mp['f']="Ph";
mp['g']="9";
mp['h']="|-|";
mp['i']="1";
mp['j']="j";
mp['k']="|<";
mp['l']="L";
mp['m']="/\\\\/\\\\";
mp['n']="|\\\\|";
mp['o']="0";
mp['p']="P";
mp['q']="Q";
mp['r']="R";
mp['s']="$";
mp['t']="7";
mp['u']="U";
mp['v']="\\\\/";
mp['w']="\\\\/\\\\/";
mp['x']="><";
mp['y']="'/";
mp['z']="Z";
  
string temp="";
  
for(int i=0;i<s.length();i++)
{
if(s[i]==' ')
temp+=' ';
else
temp+=mp[s[i]];
}
  
return temp;
}

int main()
{
  
  
string s;
cout<<"Enter a String: ";
getline(cin,s);
  
string temp=translateToL337(s);
  
cout<<temp<<endl;
  
return 0;
}

Activities Text Editor Open A Fri 23:42 AS_2.cpp Save = 0 #include cbits/stdC++.h> using namespace std; string translateToL33Activities Text Editor Open A Fri 23:43 AS_2.cpp Save = 0 p[a]-4: rolb1: mp[c]=(; rp[d]. p[e]=3; pr fil-pActivities Terminal Fri 23:43 Workshop tanish@lenovo: File Edit View Search Terminal Help tanishqalenovo: -g++ A5_2.cpp tant

Add a comment
Know the answer?
Add Answer to:
Need in pseudocode Program 2: POWIN3D. In the early 80s, hackers used to write in an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • IN JAVA. P0\/\/|\|3D. In the early 80s, hackers used to write in an obfuscated, but mostly...

    IN JAVA. P0\/\/|\|3D. In the early 80s, hackers used to write in an obfuscated, but mostly readable way called “leet” – short for “elite”.  In essence, it was a simple character replacement algorithm, where a single “regular” character was replaced by one or more “leet” characters; numbers remained the same.  Here’s one of the most readable versions: a 4 g 9 m /\\/\\ s $ y ‘/ b B h |-| n |\\| t 7 z Z c ( i...

  • Help write in pseudocode? ASCII Art. Computer graphics were really awful when Personal Computers first came...

    Help write in pseudocode? ASCII Art. Computer graphics were really awful when Personal Computers first came to market. In fact, many computers would show spreadsheets and even full video games using only ASCII characters (look up Nethack, Angband, or even Medievia). We’ll start the beginning of your ASCII Art career by drawing squares that are based on user input. Write a function called drawBox that takes in number representing the width of the square. In main, ask the user for...

  • Q16-Decoder (0.5 points) Write a code block to decode strings from secret encodings back to reada...

    Q16-Decoder (0.5 points) Write a code block to decode strings from secret encodings back to readable messages. To do so: Initialize a variable called decoded as an empty string . Use a for loop to loop across all characters of a presumed string variable called encoded Inside the loop, convert the character to another character o Get the unicode code point for the character (using ord o Subtract the value of key to that code point (which should be an...

  • CAN SOMEONE HELP WITH THIS? Part 1: power() method We want to write a method that...

    CAN SOMEONE HELP WITH THIS? Part 1: power() method We want to write a method that will enable us to calculate a number to a given power. In other words, we are writing a method to mimic what the Math.pow() method we have seen before does. To write this method use the following requirements: The method should return an integer. It should have two parameters x and y both integers. The name of this method will be power(). For the...

  • You're to write a C++ program that analyzes the contents of an external file called data.txt....

    You're to write a C++ program that analyzes the contents of an external file called data.txt. (You can create this file yourself using nano, that produces a simple ASCII text file.) The program you write will open data.txt, look at its contents and determine the number of uppercase, lowercase, digit, punctuation and whitespace characters contained in the file so that the caller can report the results to stdout. Additionally, the function will return the total number of characters read to...

  • 1. Write a C++ program called Password that handles encrypting a password. 2. The program must...

    1. Write a C++ program called Password that handles encrypting a password. 2. The program must perform encryption as follows: a. main method i. Ask the user for a password. ii. Sends the password to a boolean function called isValidPassword to check validity. 1. Returns true if password is at least 8 characters long 2. Returns false if it is not at least 8 characters long iii. If isValidPassword functions returns false 1. Print the following error message “The password...

  • Objectives: Use strings and string library functions. Write a program that asks the user to enter...

    Objectives: Use strings and string library functions. Write a program that asks the user to enter a string and output the string in all uppercase letters. The program should then display the number of white space characters in the string. You program should run continuously until the user enters an empty string. The program must use the following two functions: A function called count_spaces that counts the number of white spaces inside a string. int count_space(char str[]); which tell you...

  • Write pseudocode and the write the source code in C++, thanks! Program 0: Insulted yet? Most...

    Write pseudocode and the write the source code in C++, thanks! Program 0: Insulted yet? Most people get harassed by telemarketers, so for your warmup question, you're going to design (pseudocode) and write (source code) a program that generates (clean) insults at random. The program must have a function that takes in the name of a person and prints out an insult directed to them. Further, the program should ask if the person has had enough insults and continue until...

  • This is for C++ Write a program that reads in a sequence of characters entered by...

    This is for C++ Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must...

  • ***** PSEUDOCODE PLEASE****** ***** PSUDOCODE PLEASE****** Program 0 (Warm-up): Deoxyribonucleic acid, or DNA, is comprised of...

    ***** PSEUDOCODE PLEASE****** ***** PSUDOCODE PLEASE****** Program 0 (Warm-up): Deoxyribonucleic acid, or DNA, is comprised of four bases: (G)uanine, (C)ytosine, (A)denine and (T)hymine.  Ribonucleic acid, or RNA, is different than DNA in that it contains no Thymine; thymine is replaced with something called (U)racil.  For this assignment, you will create an array of 255 characters.  You must start by filling the array with random characters of G, C, A and T.   You must then print out the array.  Next, replace all the instances of Thymine...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT