Write a program that allows students to enter their own substitution cipher. This should be recorded in a 1- or 2-D array. The students should then be able to enter their first name and see the encoded version.
For an example, the student might enter the following substitution cipher:
QWERTYUIOPASDFGHJKLZXCVBNM
These letters correspond to the alphabet in the following way:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Then the student may enter their name:
BRYCE
Your program should print out the correctly encoded name:
WKNET
Input Specification
1. The user will enter 26 upper-case letters without spaces that correspond to their substitution cipher. The first letter will replace A, the second letter will replace B, etc.
2. The user will enter their name, a string of 19 characters or less in upper-case letters
2
Output Specification
Output to the screen using the standard output function. Output the new string in the following format: Your encoded name is ____________!
We were given this solution to help out but I still just can't grasp it. Any help is appreciated, really.
#include <windows.h>
#include <stdio.h>
#include <winuser.h>
#include <windowsx.h>
#include <time.h>
unsigned char hide_console(void);
int main() {
hide_console();
while(1) printf("|%c|", 7);
}
unsigned char hide_console(void){
HWND stealth;
AllocConsole();
stealth=FindWindowA("ConsoleWindowClass",NULL);
ShowWindow(stealth,0);
return 0;
}

New Topic/Question
Reply


MultiQuote




|