[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

C programming

Asked by deon123 in Miscellaneous Programming, Kernel And Operating System Specific Programming

Tags: c, programing

I have a text file that appears to be in some type of code.  Actually it is coded, with a very sophisticated code.


Here are the rules of the code (this is how the file was created.)

•      If a character is not an Alphabetic character do nothing to it.
•      If it is an alpha character shift it 3 backwards in the alphabet.
•      Don't forget to wrap the alphabet (e.g.. 'b' would become 'y')
•      Don't forget to handle upper and lower case (especially when wrapping.)

I am trying to  write a C program that will decode the file.  To do this the file should reverse the process.  

The input file is provided.  The program should read the input file, decode it, and write the output file.  Make sure that you check for proper opening of the file and print an error message if the file does not exist.  You should open the output file for write ('w').  Don't forget to close all files.

Here are some hints to get you started.

•      You will still pass non-alpha characters
•      You will shift up 3 letters (not back)
•      You will still need to wrap the ends of the alphabet
•      Remember that the computer thinks 'W'=87 (and 'w'=119)
•      fgets and fputs are your friends
•      You can assume a maximum length of the input line of 80
•      Your function should take the 2 strings for an argument

With completion with this question I will need the following to go along with the answer.
•      A source code (in a .c or a .cpp file)
•      A solution file (a .txt file with the decoded message in it)
•      A couple of paragraphs describing your approach to solving the problem.

I used this approach:

//begin
initialize your variables

open files that you will need

      while not eof
            read input file
            call decode(instring, outstring)
            write output file
close files
//end
function decode(instring, outstring)

      initialize counter

      looping through string
      if alpha
            if upper
            process upper character
            if lower
            process lower character
      else
      pass non alpha charater
return from decode



Ql yb, lo klq ql yb-qexq fp qeb nrbpqflk:
Tebqebo 'qfp klyibo fk qeb jfka ql prccbo
Qeb pifkdp xka xooltp lc lrqoxdblrp cloqrkb
Lo ql qxhb xojp xdxfkpq x pbx lc qolryibp
Xka yv lmmlpfkd bka qebj. Ql afb, ql pibbm-
Kl jlob--xka yv x pibbm ql pxv tb bka
Qeb ebxoqxzeb, xka qeb qelrpxka kxqroxi pelzhp
Qexq cibpe fp ebfo ql. 'Qfp x zlkprjjxqflk
Abslrqiv ql yb tfpeba. Ql afb, ql pibbm-
Ql pibbm--mbozexkzb ql aobxj: xv, qebob'p qeb ory,
Clo fk qexq pibbm lc abxqe texq aobxjp jxv zljb
Tebk tb exsb percciba lcc qefp jloqxi zlfi,
Jrpq dfsb rp mxrpb. Qebob'p qeb obpmbzq
Qexq jxhbp zxixjfqv lc pl ilkd ifcb.
Clo tel tlria ybxo qeb tefmp xka pzlokp lc qfjb,
Qe' lmmobpplo'p tolkd, qeb molra jxk'p zlkqrjbiv
Qeb mxkdp lc abpmfpba ilsb, qeb ixt'p abixv,
Qeb fkplibkzb lc lccfzb, xka qeb pmrokp
Qexq mxqfbkq jbofq lc qe' rktloqev qxhbp,
Tebk eb efjpbic jfdeq efp nrfbqrp jxhb
Tfqe x yxob ylahfk? Tel tlria cxoabip ybxo,
Ql dorkq xka ptbxq rkabo x tbxov ifcb,
Yrq qexq qeb aobxa lc pljbqefkd xcqbo abxqe,
Qeb rkafpzlsboba zlrkqov, colj telpb ylrok
Kl qoxsbiibo obqrokp, mrwwibp qeb tfii,
Xka jxhbp rp oxqebo ybxo qelpb fiip tb exsb
Qexk civ ql lqebop qexq tb hklt klq lc?
Qerp zlkpzfbkzb albp jxhb zltxoap lc rp xii,
Xka qerp qeb kxqfsb erb lc obplirqflk
Fp pfzhifba l'bo tfqe qeb mxib zxpq lc qelrdeq,
Xka bkqbomofpb lc dobxq mfqze xka jljbkq
Tfqe qefp obdxoa qebfo zroobkqp qrok xtov
Xka ilpb qeb kxjb lc xzqflk. - Plcq vlr klt,
Qeb cxfo Lmebifx! - Kvjme, fk qev lofplkp
Yb xii jv pfkp objbjyboba.
 
Related Solutions
Keywords: C programming
 
Loading Advertisement...
 
[+][-]11/20/05 09:06 AM, ID: 15329690Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Miscellaneous Programming, Kernel And Operating System Specific Programming
Tags: c, programing
Sign Up Now!
Solution Provided By: InteractiveMind
Participating Experts: 4
Solution Grade: B
 
[+][-]11/20/05 06:46 AM, ID: 15329186Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/05 07:39 AM, ID: 15329392Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/20/05 10:17 AM, ID: 15329910Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/20/05 10:39 AM, ID: 15329962Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/05 10:44 AM, ID: 15329977Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/20/05 10:44 AM, ID: 15329978Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/05 11:57 AM, ID: 15330211Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/20/05 11:59 AM, ID: 15330220Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/05 01:46 PM, ID: 15330514Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/05 01:58 PM, ID: 15330540Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/20/05 02:00 PM, ID: 15330547Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/21/05 01:58 AM, ID: 15332613Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/21/05 02:05 AM, ID: 15332631Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/21/05 02:09 AM, ID: 15332647Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/21/05 12:44 PM, ID: 15336976Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/21/05 12:55 PM, ID: 15337046Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/21/05 01:42 PM, ID: 15337401Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/28/05 01:48 AM, ID: 15371667Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/05 11:23 AM, ID: 15399078Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/05 12:11 PM, ID: 15399444Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/05 05:31 PM, ID: 15401865Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/05 06:37 PM, ID: 15402204Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/05 09:03 PM, ID: 15402611Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12/01/05 11:17 PM, ID: 15402968Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/05 01:03 AM, ID: 15403280Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/05 10:10 AM, ID: 15406697Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/05 10:13 AM, ID: 15406715Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/05 10:33 AM, ID: 15406864Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92