Python language please (also upload the result pic too)
Write a program that computes and displays the charges for a
patient’s hospital stay. First,
the program should ask if the patient was admitted as an in-patient
or an out-patient. If the
patient was an in-patient the following data should be
entered:
• The number of days spent in the hospital
• The daily rate
• Charges for hospital services (lab tests, etc.)
• Hospital medication charges.
If the patient was an out-patient the following data should be
entered:
• Charges for hospital services (lab tests, etc.)
• Hospital medication charges.
Use a single, separate function to validate that no input is less
than zero. If it is, it should
be re-entered before being returned.
Once the required data has been input and validated, the program
should use two
separate functions to calculate the total charges. One of the
functions should accept
arguments for the in-patient data, while the other function accepts
arguments for out-
patient data. Both functions should return the total charges.
CODE:=
def outPatient(charges,medication): # this function return the charges for the out patient
return charges + medication # simply adding the bills
def inPatient(day,rate,charges,medication): # this returns charges for in patient
totalDayCharges = rate*day # calculating the total days staying cost
return totalDayCharges + charges + medication # then adding all the bills
def inPutValidation(value)->float: # this will validate the inputs from the user
while value<0: # if the value is less than 0 then iterating till user enters positive value
value = float(input("Enter a positive value: "))
else:
return value # else return the value
inOut = inPutValidation(int(input("The patient was admitted as an in-patient(Enter 1) or an out-patient(Enter 2): ")))
if inOut == 1: # calculating the charges for in patient
day = int(inPutValidation(int(input("The number of days spent in the hospital: "))))
rate = inPutValidation(float(input("The daily rate: ")))
charges = inPutValidation(float(input("Charges for hospital services (lab tests, etc.): ")))
medication = inPutValidation(float(input("Hospital medication charges:")))
print("Charge for the patient’s hospital stay is", inPatient(day,rate,charges,medication))
if inOut == 2: # calculating the charges for out patient
charges = inPutValidation(float(input("Charges for hospital services (lab tests, etc.): ")))
medication = inPutValidation(float(input("Hospital medication charges: ")))
print("Charge for the patient’s hospital stay is",outPatient(charges,medication))

OUTPUT:-

FOR ANY OTHER QUERY PLEASE COMMENT.
Python language please (also upload the result pic too) Write a program that computes and displays...
Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital Medication Charges Charges for hospital services (labs, tests, etc.) The program should ask for the following data if the patient was an out-patient: Charges for hospital...
C++
Write a program that computes and displays the charges for a patient's hospital stay_First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab...
Problem: Patient Fees C++ You are to write a program that computes a patient’s bill for a hospital stay. The different components of the program are The PatientAccount class The Surgery class The Pharmacy class The main program The PatientAccount class will keep a total of the patient’s charges. It will also keep track of the number of days spent in the hospital. The group must decide on the hospital’s daily rate. The Surgery class will have stored within it...
Write a python program that computes a patients bill for a hospital stay. The different components of the program are The patientAccount class The Surgery class The Pharmacy class The main program -The PatientAccount class will keep a total of the patient's charges. It will also keep track of the number of days spent in the hospital. The group must decide on the hospital's daily rate. -The Surgery class will have stored within it the charges for at least five...
Hospital Charges ASSIGNMENT: Write a program to calculate and display the amount of the charges for a hospital stay. Create a global constant for the daily fee of a hospital room ($350.00/day). Ask the user for: The number of days spent in the hospital The amount of the medication charges The amount of the surgical charges The amount of the lab fees The amount of the physical rehabilitation charges Then, using functions, calculate the stay charges (number of days *...
c++ Write a program that computes and displays the tuition for courses offered at the University. First, the program should ask if the student has registered for a regular course or a course with a lab component. The user can enter the letter 'C' or 'c' for lecture course only, or the letter 'L' or 'l' for a laboratory course . Write a function called Menu, which takes no input parameters and returns a char value. Your main program will...
NEED RAPTOR FLOWCHART PLEASE Write a program that computes how many feet an object falls in 1 second, 2 seconds, etc., up to 10 seconds. First, create a Raptor flowchart. For this assignment, you will need to switch to intermediate mode. Your Raptor program should: 1. Have a procedure called FallingDistance, which has one input parameter, seconds, and one output parameter, distance. 2. Compute the distance in feet an object falls using this formula: d = ½ gt2 (where g...
Write MIPS code, please. Following: Write a program to be used by the Wisconsin DNR to track the number of Deer Hunting Licenses issued in a county and the state. It will display a menu with 5 choices numbered 1-5. They are (1) update the count, (2) display the number of licenses already issued to a county whose number is input, (3) display the county number and the number of licenses already issued to a range of counties whose starting...
I need help with my homework please. I should write this program
in C++ language and use Inventory.h file (header file),
Inventory.cpp file (implementation file), and main.cpp file (main
program).
This is the program:
Demonstrate the class in a driver program. Input validation,
don’t accept negative values for item number, quantity, or
cost.
6. Inventory Class Design an Inventory class that can hold information and calculate data for items ma retail store's inventory. The class should have the following private...
PLEASE WRITE CODE FOR C++ ! Time Validation, Leap Year and Money Growth PartA: Validate Day and Time Write a program that reads a values for hour and minute from the input test file timeData.txt . The data read for valid hour and valid minute entries. Assume you are working with a 24 hour time format. Your program should use functions called validateHour and validateMinutes. Below is a sample of the format to use for your output file timeValidation.txt : ...