Design the algorithm for function in pseudo-code

Assignment Help Computer Engineering
Reference no: EM133337882

Case: As a defensive programmer, we have to assume that the user will give us an input message on the command line which has characters which are not uppercase. But the Caesar algorithm can only encrypt uppercase letters. We need to deal with this.

(We need a function which takes as input the string of text that the user gave us on the command line. It will return a new string of text which is suitable for encryption by the Caesar cipher, i.e. it must be all uppercase letters.

Here is the (partial) API for this function. It will be called convert_to_Caesar(). It will take one argument: a string of text. It will return: a string of text. The letters in the argument will be processed as follows:

  • uppercase letters will be left untouched
  • lowercase letters will be converted to uppercase letters: 'a' →'A', 'b' → 'B' etc.
  • the full stop '.' will be translated to the letter 'X' (as 'X' is rare, we can use it to separate sentences)
  • all other letters in the argument will be discarded

You will design the algorithm for this function in pseudo-code, i.e. semi-English. The algorithm must have these properties:

  • it must be guaranteed to stop and return a string regardless of the argument it is given
  • it must obey the API contract defined above regardless of the argument it is given
  • it must not crash or do unexpected things regardless of the argument it is given
  • the algorithm must be written in simple enough steps that it can be translated into a computer language like Python
  • the algorithm must be exact and well-defined, i.e. not open to interpretation

You will use English words like "if", "while" and "for" where they are suitable. These make sense to an English reader, but they also indicate programming structures such as sequence, selection and iteration to a programmer.)

Your task now is to create a single Python program called caesar.py. It will contain the two functions from the previous tasks. It will read in the user's inputs from the command line and perform the top-level pseudo-code. As you have already been given this pseudo-code, there is no need for you to write it.

  1. Step 1: Write Tests for the Program

This time, we are writing a full Python program (i.e. a software application) and not just a function. However, we can still test it, as the user will enter two input values on the command line( by using import sys and argv), and your program will output a piece of encrypted text.

Reference no: EM133337882

Questions Cloud

Implement security for applications : IT 501 Wells International College Implement security for applications by creating a simple e-Commerce and Learning Management System
What type of system development process technique : The luxury of taking a long time to consider all their options what type of system development process technique would you suggest?
Write a find command that finds all files : COMPUTER I CIS3512 Penn Foster College Write a sed command that will display all lines of the months file that do not contain the string March. What was
Implications for enchancing a depression website : State key policy (e.g., reimbursement), legal (e.g., FDA approval), standards that have (adherence required) implications for ENCHANCING A DEPRESSION WEBSITE?
Design the algorithm for function in pseudo-code : Create a single Python program called caesar - design the algorithm for this function in pseudo-code
Prepare the country to address cyber attacks : INFOST 491 University of Wisconsin, Based on your reflections about cyber security, expound on what would be your top five ways to best prepare the country
What is process of finding a network vulnerability : What is the step by step process of finding a network vulnerability? I have to find 3 network vulnerabilities using Kali Linux and Metasploitable 2.
Identify ethical issues related to managerial decision : Identify ethical issues related to managerial decision making. Search the Internet, join discussion groups/blogs, and read articles from the Internet
Which three of the five criteria do you find to be the most : Which three of the five criteria do you find to be the most important? Do they seem like enough to evaluate a website? How would you define each criterion

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd