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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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