Reference no: EM131895973
Assignment
1. Write a program that takes two arguments, two positive integers m and n such that m < n, and prints the sum m + ( m + 1) + • • • + n.
2. Write a program that prints the range of a sequence of integers provided through stdin. For example, the range of -3, 15, -8, 29, 17 is 29 - (-8) = 37.
3. Write a program according to the following specification:
a. It has two possible command-line arguments: -s indicates "shout" mode, while -w indicates "whisper" mode.
b. It reads an arbitrary list of strings from stdin.
c. It writes the strings to stdout, except that it writes all letters in either uppercase or lowercase according to the mode.
4. Write a program according to the following specification:
a. It reads an arbitrary list of strings from stdin.
b. It records the number of vowels encountered.
c. It prints the number of occurrences of each vowel to stdout.
5. Write a program, called hide, according to the following specification:
a. It has two possible arguments: -encrypt indicates encryption mode, while -decrypt indicates decryption mode.
b. It reads an arbitrary list of strings from stdin.
c. It applies a cypher to the strings. You may invent your own, but a simple one is to shift the letters by a constant amount (for example, 'a' becomes 'd', and 'z' becomes 'c'). It either encrypts or decrypts the strings ("shifts" or "deshifts" the letters) depending on the mode.
d. It prints the encrypted or decrypted text to stdout.
e. At minimum, it should be able to handle text consisting only of lowercase letters. For example, if the message attention home planet stop prepare invasion stop earth is ripe for the taking stop cu soon full stop is in file msg.txt, then $ ./hide -encrypt < msg.txt > msge.txt would produce the following cyphertext in file msge.txt if hide is using a shift of 12: mffqzfuaztayqbxmzqfefabbdqbmdquzhmeuazefabqmdftuedubq rad ftqfmwuzsefabogeaazrgxxefab.
f. Then $ ./hide -decrypt < msge.txt would yield the original message. Using Unix piping would also result in the output of the original message: $ ./hide -encrypt < msg.txt | ./hide -decrypt To achieve the proper shift, use the following formula: 'a' + (((c - 'a') + sh) % 26) The idea is to find c's position in the alphabet (c - 'a'), add the shift ((c - 'a') + sh) modulo 26 (((c - 'a') + sh) % 26), and finally translate the character back into the ASCII range for lowercase letters. To unshift, set sh to 26 - sh and use the same formula. For example, if sh is 12, then 'a' + (((c - 'a') + 12) % 26) yields 'q' if c == 'e' since 'q' is 12 characters later than 'e'; and 'f' if c == 't' since 'f' is 12 characters later than 't' modulo 26.
What is the relative distance of each to the united states
: Apply the CAGE distance framework to the six foreign countries where Clif Bar is operating. What is the relative distance of each to the United States?
|
Percentage of cytosine in the dna of organism
: What is the percentage of cytosine in the DNA of this organism?
|
Chromosomes shorten after each round of replication
: You identify a mutant whose chromosomes shorten after each round of replication. A mutation in which gene would explain this observation?
|
Propose a model of alternative splicing
: Propose a model of alternative splicing for this gene that can account for these facts.
|
Write a program that prints range of a sequence of integers
: Write a program that prints the range of a sequence of integers provided through stdin. For example, the range of -3, 15, -8, 29, 17 is 29 - (-8) = 37.
|
Pericentric inversion takes place on the x chromosome
: If a pericentric inversion takes place on the X chromosome, will it affect males, females, or both? Why?
|
Prepare a trial balance for the end of the period
: Record the following transactions in the journal of Howell Consulting. Explanations are not required. Prepare a trial balance for the end of the period
|
Combination of the mutants and looks
: To determine whether these mutations occur at the same functional gene, he simultaneously infects E. coli K with paired combination of the mutants and looks
|
How would you describe the software process you used
: How would you describe the software process you used to accomplish question 3? Which of the primary software activities did you perform, and in what order?
|