Project #88538 - perl programming

 

2. (15 pts) Write a Perl program that prints out all the even numbers from 0 to 20. Print this list 4 times, using while, until, do-until and for loops (so you need to use all 4 loop structures! Just to give you practice in using them). Also make sure to use the % function (don’t just add 2!).

 

 

3. (10 pts) Write a Perl program that calculates the AT and GC content (i.e. the percentage of G and C, and the percentage of A and T) in a given sequence. You can make up your own dummy sequence and store it as a scalar variable for this question (no need to take it from a file here). Print out the results to a file called DNA_Statistics, the result should look something like this:

The GC content of the DNA sequence give is: 48.5%
The AT content of the DNA sequence give is: 51.5%

Here is a sample DNA sequence for you to use: ‘ACGTAGCGCGTAATAGGCGCCGCGTCAACGCATGACGATCGT’. But your code should work with ANY given DNA sequence! You can declare your sequence as a string in your code, i.e. no need to read it from a file

 

5. (15 pts) Write a Perl program (call it Ques5A.pl) that takes user entered lines from the keyboard and stores them in an array. When the user enters "quit", the program prints out all the lines sorted (ASCII order – i.e. a line starting with an “Ab…” would print out before one starting with “Ac…”). Now modify the program (call it Ques5B.pl) so it tells you how many lines have been entered, and then prints out only lines 2, 3, and 4.

 

6. (10 pts) Write a Perl program to read a file, and then print its lines in reverse order, the last line first. Create a dummy file and insert sequences or random text, to test your program with.

 

7. (15 pts) Ask the user for a list of sequence lengths, separated by whitespace (Example: 100 123 45 …etc.). The sequence lengths will be stored in a string called $input.

a. Split the String $input and create an array.

b. Use the foreach loop to get the sum of all sequence lengths.

c. Print the average.

 

8. (10 pts) Write a program that displays a table of centigrade temperatures 0 through 20 and their Fahrenheit equivalents. The formula for converting a temperature from centigrade to Fahrenheit is:

     F =  9\5 * C + 32

Where F is the Fahrenheit temperature and C is the centigrade temperature. Your program must use a loop to display the table.

 

Subject Computer
Due By (Pacific Time) 10/22/2015 03:00 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy