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

  Debug a simple visual basic program

The GUI program will have a button that creates a new window with the word Hello. Enhance the display by making the word change color, move, or change to another language (such as Hola).

  Develop a program to determine the final scores

In this project, you will develop a program to determine the final scores, letter grades, and rankings of all students in a course. All records of the course will be stored in an input file, and a record of each student will include the first name..

  Identify where each security application or countermeasure

Briefly describe each of the listed network security applications and security countermeasures. Identify where each security application or countermeasure is located within the seven domains of a typical IT infrastructure.

  Complete the program that solves the eight queens problem

Complete the program that solves the Eight Queens problem. The program's output should look similar to:

  Write a program using binary search approach

Write a program using binary search approach

  Compute the total sales and commission rate applied

Write a program that prompts a salesman to enter his-her status and total sales. Compute the following: their status; total sales; commission rate applied; the commission ($) earned (the appropriate rate times the sales)

  Top-down recursive descent parser

Write a hand-coded top-down recursive descent parser.

  Show the source code for console application

Show the source code for a C# console application named"MyName" that prints your last name, a tab, and then your first name.

  Presenting football greatest expertise of reviewing

The start of Buy Fifa Coins the one of the most well-known minutes presenting football greatest expertise of reviewing. Before we look into the coordinate it is only reasonable to take a brief look into the gamer considered as one of the best game..

  Explain book constructor to accept and initialize data

Create and execute the class called Book which contains instance data for title, author, publisher, and copyright date. Explain the Book constructor to accept and initialize this data.

  Design a class-based solution to a problem

To design a class-based solution to a problem using multiple data structures.

  Write a perl program that given a dna string

Write a Perl program that given a DNA string, prints out the 20 characters upstream of the start codon ATG

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