You are on page 1of 2

Assignment #8

Introduction to C Programming COP 3223

Objectives 1. To reinforce knowledge about arrays 2. To reinforce knowledge of strings Introduction: Math Academy A new tutoring center is opening in your area. The managers of this center know that math is difficult for many students, so they would like to have a number of programs to support their Math Academy. The Math Academy has hired you to help them create programs to help students learn and keep track of student progress. Problem: Code Writing (code.c) The Math Academy would like to reward the students hard work with a fun activity. A substitution cipher is a code that substitutes each letter in the alphabet with a different letter. An common example is shown below. A B Z Z Y .. A

The Math Academy would like you to 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 ____________! Output Sample Below is a sample output of running the program based on the sample input file. Note that this sample is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given above. In the sample run below, for clarity and ease of reading, the user input is given in italics while the program output is in bold. (Note: When you actually run your program no bold or italics should appear at all. These are simply used in this description for claritys sake.) Sample Run What is your substitution cipher? QAZWSXEDCRFVTGBYHNUJMIKOLP What is your name? SARAH Your encoded name is UQNQD! Deliverables One source file code.c is to be submitted over WebCourses. Restrictions Although you may use other compilers, your program must compile and run using Code::Blocks. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include comments throughout your code describing the major steps in solving the problem. Grading Details Your programs will be graded upon the following criteria: 1) Your correctness 2) Your programming style and use of white space. Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor, you could get 10% or 15% deducted from your grade. 3) Compatibility You must submit C source files that can be compiled and executed in a standard C Development Environment. If your program does not compile, you will get a sizable deduction from your grade.

You might also like