Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

rite two C programs. First program (encrypt.c) executes a Caesar cipher, which used to encrypt text messages in the files. Second program (team.c) maintains information for the soccer team. Data in your team would be stored in the memory with the use of a linked list, with list nodes representing players.

A. Caesar’s Cipher for Files

prepare the C program “encrypt.c” which encrypts the message using one of an oldest known encryption techniques,called Caesar cipher, attributed to Julius Caesar. It involves replacing each letter in the message with another letter which is the fixed number of positions later in a alphabet (shift). If replacement will go past the letter Z, the cipher “wraps around” to the starting of the alphabet. like, if each letter is replaced by a letter two positions after it (shift by 2), then A will be replaced by a letter C, Y will be replaced by a letter A, and Z will be replaced by a letter B. Program must get two arguments:

(a) name of a file containing message to be encrypted and

(b) shift amount as the valid integer from 1 to 25 (inclusive).

Here’s the ex of a call to the program:

$ ./encrypt message.txt 3

Program then prepares encrypted message to new file with similar name but the added extension of .enc. In ex given above, original file name is message.txt, so encrypted message would be stored in a file named message.txt.enc.

You might suppose that:

• There is no limit on size of the file to be encrypted or on the length of each line in the file.

• Characters other than letters must be left analtered.

• Lower-case letters remain lower-case and upper-case letters remain upper-case.

Notice that program could also be used to decrypt a message if the user knows the original key by providing the encrypted message and using as shift amount 26 minus the original key. As an ex:

$ ./encrypt message.txt.enc 23

B. Linked Lists

prepare a C program “team.c” which maintains information for a soccer team. The program would permit you to add and delete players from your team, to search your team for players by name or by value they are worth, and to print out part or all of the team.

The data in your team would be stored in memory with the help of a linked list, with list nodes representing players. Each node would contain members for storing a player’s family name (char *) and first name (char *), their position (char) and their value (int). There are four possible positions, each of which is identified by the first character in the words (G)oalkeeper, (D)efender, (M)idfielder and (S)triker. Your linked list should be kept in a special order, with all goalkeepers first, then defenders, then midfielders, and at last the strikers. If there is more than one player in same position, then players must be kept in order of their insertion (e.g., the last defender in the team, must be the defender most recently inserted into the list; the first striker in the team must be the striker that was inserted first into list, and so on). You might suppose that no two players that assume the same position in your team have same family name.
Your program must be menu driven, with user being offered a choice of the six commands described below:

• Insert new player into a team. Program must prompt user for the new family name and first name, a position and a value. This information must be placed in new node that has been created using malloc function. And then node must be inserted at a suitable position in the linked list which stores the team data. Do not forget that team should be stored in special order, by considering the player’s position first, and then (if needed) the order of insertion. If the node with given family name is already in a team, an error message must be produced and new node must not be inserted into a linked list.

• Delete player from the team. Program must prompt the user for the family name of the player to be deleted and then delete node containing that family name from the linked list which stores the team. If no player with the given family name is found in the team, an error message must be produced.

• Search for the player using input family name. Program must print the family name, first name, position and value of the player, with each piece of information on a separate line. If no player with given family name is found in the team, an error message must be produced.

• Search for players in team which are worth less than or equal to an input value. Program must print family name, first name, position and value of any player which is worth less than or equal to the input value, with information of each player on the separate line. Blank line must be printed between each player (if more than one is found). If no player in team is worth less than or equal to the given value, the error message must be produced.

• Print team, following special order. Print family name, first name, position and value of each player, with each piece of information on separate line. A blank line must be printed between each player. Special order supposes that goalkeepers appear first, then defenders, then midfielders, and at last strikers. If there are more than one players of same position, then they must be printed in order of their insertion.

• Quit program. When a program is given the quit command, it must delete all nodes in linked list by using calls to free function. It must then try to print linked list.

It is suggested that you finish and test each step before moving on to next one. This way, if the program no longer works, you would know which statements are causing an error.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91865

Have any Question? 


Related Questions in Programming Language

Lab- forms loops and stringssubmission Lab- Forms, Loops and Strings Submission

Lab- Forms, Loops and Strings Submission Instructions How Please submit your lab report to the Lab4_Submission folder in Moodle. When Labs are due in 1 week on Feb. 13, 2014 Exercises: Goals: - Gain more hands-on with us ...

Programming computer science assignmmentprogramming1

Programming Computer Science Assignmment Programming 1) Explain the difference between an event and an event handler. Provide at least two examples of an event. 2) Explain how an animation uses still images and loops to ...

Programming project sorting to find anagramssee project 4

Programming Project Sorting to find anagrams See Project 4 on pg. 869 for the basic ideas of this project. We will find the longest anagrams in the words.txt provided in the Chapter 13 files on the author's website. 1. F ...

Assignmenteagle airlines has contracted you to implement a

Assignment Eagle Airlines has contracted you to implement a basic airline ticketing system for passengers. Your program will allow the application's user to enter the information associated with each passenger. The ticke ...

Resources appendices a amp dexamine the following

Resources: Appendices A & D Examine the following situation: Your company, Datamax, Inc., is in the process of automating its payroll systems. Your manager has asked you to create a program that calculates overtime pay f ...

Evaluate a formula for data in a filewe consider the

Evaluate a formula for data in a file We consider the formula y(t) = v0t - 0.5gt2 and want to evaluate y for a range of t values found in a file with format v0: 3.00 t: 0.15592 0.28075 0.36807889 0.35 0.57681501876 0.213 ...

1 write a program that reads input as a stream of

1. Write a program that reads input as a stream of characters until encountering EOF. Have the program report the number of uppercase characters, the number of lowercase characters, and the number of other characters rea ...

Assignmentinstructions the following programming problem

Assignment Instructions: The following programming problem can be solved by a program that uses three basic tasks-Input Data, Process Data, and Output Results. To process the data, it uses loops, arrays, decisions, accum ...

Programming taskswhile working on the tasks below you are

Programming tasks While working on the tasks below, you are free to request assistance on D2L at: Communications / Discussions / Assignments (or other appropriate sub-topic) These tasks entail modifying your prior code f ...

Assignmentinstructionsfor formload display use a textbox

Assignment Instructions: For Form_Load display, use a textbox and check its "multiline" checkbox. To display data on Form_Load, use a txtOutput. AppendText() method (i.e. NOT a listbox control). 1. Declare a global array ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen