### Write a perl subroutine for temperature conversion

Assignment Help PL-SQL Programming
##### Reference no: EM1389800

Question 1:

Write a perl subroutine for temperature conversion named 'convert_temp'. It should be able to handle both Fahrenheit to Celsius conversions as well as Celsius to Fahrenheit conversions. It must accept and read two arguments that are passed to it: first, the temperature scale of the original temperature (only 'F' or 'C' should be used), and second, the number of degrees of the original temperature. It should then convert the original temperature from Fahrenheit to Celsius or from Celsius to Fahrenheit, as appropriate. Finally, this subroutine should print out the original temperature and scale as well as the converted temperature and scale.

Then write a short program to use the subroutine you wrote (both the subroutine and program should be part of the same file). Your program should prompt the user to enter a temperature scale (assume the user will choose to type 'F' or 'C') and then prompt the user to enter a number of degrees. Using the values supplied by the user, the program should then call the 'convert_temp' subroutine and pass in the two arguments, along these lines:

convert_temp(\$scale, \$degrees);

and the subroutine should produce a line of output that looks like this (for Fahrenheit to Celsius):

98.6 degrees F is 37.0 degrees C

or, for a Celsius to Fahrenheit conversion:

100.0 degrees C is 212.0 degrees F

The first temperature and scale that you should report are those that the user entered, followed by the converted temperature and other scale.

Question 2:

Write a program that prompts the user to enter an oligonucleotide sequence, such as TATGAGCCCGTA. If the user entered a valid oligo sequence consisting only of the characters A, C, G, or T, the program should then display the reverse complement of that sequence, in this case TACGGGCTCATA, along with text indicating that it is the reverse complement.

After displaying the reverse complement, the program should then prompt the user to enter another sequence. The program should continue this pattern of prompting the user for a new oligo sequence and displaying its reverse complement until the user enters a sequence with at least one character that is invalid (i.e. a character other than A, C, G, or T). At this point, the program should end its run with a message that mentions that an invalid character was found, with no further prompting to the user.

Did you know that the reverse() function not only works on arrays, but also in a scalar context where it reverses the letters of a text string? Quite useful! For example:

my \$text = "Larry Wall";

reverse(\$text);    # \$text now contains "llaW yrraL"

#### Questions Cloud

 Eminent domain is a morally legitimate right of government : Do you believe that eminent domain is a morally legitimate right of government? Explain why or why not. Give examples of where the exercise of eminent domain has had positive effects Elaboration on multiple statistics concepts : For this assignment employ the data below which was taken from the previous online class. Find out if the data is qualitative or quantitative, continuous or discrete, and determine the level of measurement. Predict the ratios of phenotypes among the offspring : The genes for body color and wing size in Drosophila are on the same chromosome and forecast the ratios of the following phenotypes among the offspring, Utilitarian view from a standpoint of economic distribution : Utilitarian view from the standpoint of economic distribution, worker partcipation (principles of political Economy). and greater equality of income. Write a perl subroutine for temperature conversion : Write a perl subroutine for temperature conversion named 'convert_temp'. It should be able to handle both Fahrenheit to Celsius conversions as well as Celsius to Fahrenheit conversions. Working with statistical terminology : A cereal manufacturer seeks to test their newest product against competitor's. A group of 100 children was asked to measure each brand, and then to express a preference. American companies do more good by refusing to cooperte : Would American companies do more good by refusing to cooperte with Chinese authorities and risk not being able to do business in china What is the average amount of safety stock : What is the average amount of safety stock for the reorder point in (a)? What are the total variable weekly costs including safety stock costs? Explain the possible fates of dna : Explain the possible fates of DNA that in brought into the recipient cell during generalized transduction.

### Write a Review

#### PL-SQL Programming Questions & Answers

Explain how you will go about developing this database. Provide at least four queries that answer some of the questions asked by the end users.

#### What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

#### Write queries in sql if employee works on every project

Write the following queries in SQL: If an employee works on every project located in Houston, then list the employees social security number and name.

#### Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

#### Convert requirement to logic and then to sql

Prepare the SQL query for each of given requirements. Convert requirement to logic, then to SQL. Illustrate the names of all products which have been sold.

#### Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

#### Sql statement which select names and owners of great danes

Write SQL statement which would select each of the following: names and owners of all Great Danes and all attributes of poodles whose balance is no greater than \$50.

#### Write sql statement to display first-last name of students

Write a SQL statement to display the First and Last name of students who have the Status greater than 1 and less than 10. Use BETWEEN.

#### Create report to display scr courses in alphabetical order

Create the detail report which will display all SCR courses in alphabetical order, with a course name and instructor name in the group header.

#### Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

#### Describe the meaning of keyword exists and not exists

Describe the meaning of the keyword EXISTS. Describe how any and all relate to EXISTS and NOT EXISTS. Write a query which will display names of any customers who are interested in all artists.

#### Write sql statement to add new record to part table

Write SQL statement which creates the stored procedure which adds new record to the Part table, and returns value of newly created PartID PK value in out parameter.