Question 1write a perl subroutine for temperature

Assignment Help PL-SQL Programming
Reference no: EM13371400

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"

Reference no: EM13371400

Questions Cloud

1 you need to select a different topic topics should be : 1. you need to select a different topic. topics should be sufficiently specific avoiding general topics such as
Question 1 over 90 of the nations school districts : question 1 over 90 of the nations school districts according to a recent research published in the journal of education
1 the following equations characterize the goods : 1. the following equations characterize the goods market in an open economy c 600
In this assignment you will build a small database to : in this assignment you will build a small database to support the needs of a private library company called libloan. to
Question 1write a perl subroutine for temperature : question 1write a perl subroutine for temperature conversion named converttemp. it should be able to handle both
1customers perceptions of what they get for what they have : 1.customers perceptions of what they get for what they have to give up is referred to as customer
You are expected to complete a project related to : you are expected to complete a project related to inferential statistics. the project must contain the following
1 math is a rectangle dh htthe area of triangle dht is : 1. math is a rectangle. dh ht.the area of triangle dht is 8 .the area of triangle aht is 3 .what is the area of
Q1 clifton distributing has three plants and four : q.1. clifton distributing has three plants and four distribution centers. the plants their supply the distribution

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write a sql query for each of the following requirement

MIS 4300 / ACCT 4300 Database Fundamentals Spring 2014. How many times the vendor has placed an order for the item ID = 1 (rename it as NUMORD)?

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  How to understand sql ddl and dml

Task one will provide a relational database implementation of the sample solution from the first assignment. This should be done using CASE software (the choice will be up to you).

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Script that creates and calls a function

Write a script that creates and calls a function named fnItemTotal that calculates the total amount of an item in the OrderItems table (discount price multiplied by quantity)

  Perform the tasks below by using the correct sql statements

Create a view so that supplier 'ASP' can only see his information from the l_foods table.  Call this view_l_foods_ASP.  Show columns supplier_id, product_code, menu_item, description, and price in your view.

  Give me a list of all the proposed prices

Give me a list of all the proposed prices for the next year from the l_foods table.  Sort your results by proposed_price.  (Note that proposed price, is price + price_increase.)

  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 pl-sql block to display the last name of people

Write a PL/SQL block that displays the last name and salary of the following people. Each of these can be done separately as PL/SQL, first to test and get the output lines then encapsulated in the procedure.

  The cast function to return the date added column

A column that uses the CAST function to return the DateAdded column with its full time only (hour, minutes, seconds, and milliseconds)

  Question 1 given the series rlc resonant circuit in the

question 1 given the series rlc resonant circuit in the figure operating at variable frequency determinenbspa. the

  Write the sql ddl to create the database

Write a command that will remove the Jones that lives in Orange from the Customer table .Write the SQL DDL to create the database that contains each of the relations shown in the above ERD.

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