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

Assignmentcase problem1 - online trivia found on pages

Assignment: Case Problem1 - Online Trivia found on pages 794-795 of your textbook. Complete the web pages and upload them to your 000WebHost account. After uploading the files make sure to update your index.html page to ...

You must do this assignment correctly as described

You must do this assignment correctly as described below.  If you do not follow the directions or break the rules you will receive a 0 score. Simulation of checking tic-tac-toe board for wins by counting X and O in rows, ...

Your problem is as followswrite a program that will ask the

Your problem is as follows: Write a program that will ask the user to enter 4 quiz scores for 3 students.  You will need to fine the lowest quiz grade and drop it out when you calculate the average. You will need to disp ...

Integrative programmingassignment- managing a user account

Integrative Programming Assignment- Managing a User Account List Objective: To manage a user list that can be modified and saved to a text file. Inputs: • Input text file consisting of pairs of usernames and passwords, s ...

Object oriented system analysis and design1non-functional

Object Oriented System Analysis and Design 1. Non-Functional Requirements a) Analysis of NFRs Analyse the Case Study documents and determine the non-functional requirements (NFRs) or system quality attributes necessary t ...

Operating systems assignment-1 binary record sorting in

Operating Systems Assignment- 1. Binary Record Sorting in Ascending Order| You will write a simple sorting program. This program should be invoked as follows: shell% ./fastsort -i inputfile -o outputfile The above line m ...

Csis program homeworkwrite a program where the user will

CSIS program homework Write a program where the user will enter a number between 1 and 50 representing a state. The program should display the full name of that state. Assume the states are in alphabetical order, that is ...

1 construct a markov algorithm that will reverse the order

1) Construct a Markov Algorithm that will reverse the order of an input string that consists of zero or more upper case letters. ABCDE should become EDCBA, AB should become BA, A should stay A, and A should stay A. NOTE: ...

Programming lab assignment set awhat to submitcomplete

Programming Lab Assignment (Set A) What to Submit Complete Problem Solving Steps 1 - 3 (check plan, data analysis, initial algorithm, and refinement algorithm) for the following programs. 1. (Name: lab1a-1.cpp) Write a p ...

Cp1404cp5632 2016 sp22252 assignment 1 - shopping list

CP1404/CP5632 2016 SP2/22/52 Assignment 1 - Shopping List 1.0 Task: You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will hel ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate