Evaluate a problem of perl language

Assignment Help Programming Languages
Reference no: EM13935433

When a user enters 101 for a temperature the program states the patient has expired which is not the correct response. How do I correct the problem.

#!/usr/bin/perl

sub bodytemp
{
print"Please Enter Patients Temperature between 85.0 to 105.0: ";
$btemp = <STDIN>;

if($btemp < 70.0 || $btemp > 105.0){
print "Invalid Temperature!\n";
next;}

if($btemp >= 102.0 && $btemp < 106.0){
print "Give Tylenol 2 tablets 325 mg each or suppository every 4 hours.\n";
}
elsif ($btemp > 101.0 && $btemp < 101.9){
print "Give Tylenol 2 tablets 325 mg each or suppository every 4 hours as needed for temperature.\n";
}
elsif ($btemp > 95.0 && $btemp < 100.9){
print "Patient temperature is within normal limits and no corrective action is needed at this time.\n";
}
elsif ($btemp > 85.0 && $btemp < 94.9){
print "Patient is hypothermic and must be warmed up slowly.\n";
}
else{
print "Patient has expired.\n";
}

}
sub resprate
{
print"Enter Patient Respiratory Rate Based on a 1 Minute Count: ";
$resp = <STDIN>;

if($resp < 0 || $resp > 50){
print"Invalid Respiratory Rate!\n";
next;}

if($resp > 40 && $resp < 51){

}
elsif($resp > 12 && $resp < 39){
print"Respiratory Rate is Normal.\n";
}
else{
print"Start Respiratory Rescue!\n";
}

}
sub patientweight
{
print"Enter Patient Weight in Pounds: ";
$wt = <STDIN>;

if($wt < 0 || $wt > 400){
print"Invalid Weight!\n";
next;}

$pwt = $wt/2.2;

printf"Patient Weight in kg: %8.2f\n", $pwt;
}

VITAL:{
while(1){
&bodytemp;
&resprate;
&patientweight;

print "Ready to quit (yes or no)? ";
chomp($answer = <STDIN>);
if ("$answer" eq "yes") {last;}
redo VITAL;
}
}

 

 

Reference no: EM13935433

Questions Cloud

Calculate the coefficients a of after two finite barrier : For the following system, use Matlab to: Calculate the coefficients A' of ?? after two finite barriers via transfer matrix approach. Calculate transmission probability (T=|A'|2/|A|2) in case of E>V. Choose E = 4 eV, V = 2 eV, a = 0.1 nm, b = 0.3 nm
What is the value of a put option with a strike price : An investor bought 400 shares of stock when its price was $40/share. The price of the stock is now up to $75/share and the investor decides to hedge his position by purchasing 4 puts (premium = $7.50, exercise price of 75). What is the value of a put..
Explain the importance of using a chomestat system : Define and explain the importance of using a chomestat system. What is logarithmic growth/exponential growth and how is the population count calculated?
Increase in the expected inflation rate : Suppose Baa-rated bonds currently yield 8.4%, while Aa-rated bonds yield 6.4%. Now suppose that due to an increase in the expected inflation rate, the yields on both bonds increase by 1.5%. What would happen to the confidence index?
Evaluate a problem of perl language : When a user enters 101 for a temperature the program states the patient has expired which is not the correct response. How do I correct the problem.
What is the firms market value capital structure : Organic Produce Corporation has 9.3 million shares of common stock outstanding, 680,000 shares of 7.3 percent preferred stock outstanding, and 193,000 of 8.5 percent semiannual bonds outstanding, par value $1,000 each. What is the firm's market value..
How much money must you pay into an account : How much money must you pay into an account at the end of each of 20 years in order to have $100,000 at the end of the 20th year? Assume that the account pays 6% per year, and round to the nearest $1. a. $2,718 b. $2,195 C. $1,840 d. $2,028.
True for a limited partnership : Which of the following is NOT true for a limited partnership? a. Limited partners may sell their interest in the company b. Limited partners can only manage the business c. One general partner must exist who has unlimited liability d. Only the name o..
Compute the variable and fixed cost elements : Compute the variable and fixed cost elements using the high-low method. Determine the inn's break-even point in (1) number of rented rooms per month and (2) dollars.

Reviews

Write a Review

Programming Languages Questions & Answers

  Which functions perform assignment score to private member

Consider this class definition: class quiz { public: quiz( ); int f( ); int g( ) const; private: double score; }; Which functions can carry out an assignment score=1.0; to the private member variable score?

  Program to compute unit price of items sold

Manager of a Supermarket would like to be able to calculate the unit price of items sold there. To do this the program should input the name and the price of the item.

  Create program in pseudocode to compute amount of money

Create the program in pseudocode which computes the amount of money a person would earn over period of time if their salary is one penny first day.

  Write program to accept name and score of all batsmen

Write a program to accept name and score of all batsmen of a team and print them in the given manner: INPUT:names[]={nam1,nam2,nam3,nam4,nam5,nam6} & scores[]={48,65,73,10,90,84}

  What is a chief concern of cloud computing

What is a chief concern of cloud computing

  Manage the tags associated with web resources

A product that is the tagging of web resources; it would allow the tagging, as well as the management of the tags; perhaps it would include different ways of browsing and visualizing tags (e.g., tag clouds).

  Calculate the total price based on several key parts

Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts.

  Develop program for concrete class in hierarchy

Develop program which reference objects of each concrete (non-abstract) class in hierarchy. Write down abstract method "display" which determines whether displayed shape is TwoDimensionalShape.

  Program to ask how many games are being purchased

Your program should ask the store clerk how many games are being purchased and calculate a total due (with 6% tax). The total number of games, the discount amount.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Complete the function function has three parameters

Complete the function: func in the following program. This function has three parameters: The first and second parameters are of type: int. The third one is a function that has two parameters of type: int and returns a value of type: int.

  Hubspot: inbound marketing and web 2.0

Hubspot: Inbound Marketing and Web 2.0

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