Write the program WritePatientRecords that allows a doctor’s staff to enter data about patients and saves the data to a file called Patients.txt. The output should be in the following format: p#, PATIENT_NAME, BALANCE. Create a Patient class that contains fields for ID number, name, and current balance owed to the doctor’s office.
Save the contents of your output file as you will use them in the subsequent labs.
An example of the program is shown below:
Enter patient ID number or 999 to quit >> PID24584521 Enter last name >> White Enter balance >> 200 Enter next patient ID number or 999 to quit >> PID98512456 Enter last name >> Pink Enter balance >> 450 Enter next patient ID number or 999 to quit >> PID21578345 Enter last name >> Brown Enter balance >> 1000 Enter next patient ID number or 999 to quit >> PID74315491 Enter last name >> Blue Enter balance >> 650 Enter next patient ID number or 999 to quit >> 999
And the contents of the Patients.txt file:
PID24584521,White,200 PID98512456,Pink,450 PID21578345,Brown,1000 PID74315491,Blue,650
#source code in python:
class Patient:
id=""
name=""
balance=0
if __name__=="__main__":
p=Patient()
f=open("Patients.txt","a")
while(True):
p.id=input("Enter patient ID number or 999 to quit >>")
if(p.id=="999"):
break
p.name=input("Enter last name >>")
p.balance=int(input("Enter balance >>"))
datalist=[p.id,p.name,str(p.balance)]
f.write(",".join(datalist))
f.write("\n")
f.close()
#output:
#if you have any doubt or more information needed comment below..i will respond as possible as soon...thanks....
Write the program WritePatientRecords that allows a doctor’s staff to enter data about patients and saves...
Write the program WritePatientRecords that allows a doctor’s staff to enter data about patients and saves the data to a file called Patients.txt. The output should be in the following format: p#, PATIENT_NAME, BALANCE. Create a Patient class that contains fields for ID number, name, and current balance owed to the doctor’s office. using System; using static System.Console; using System.IO; class WritePatientRecords { static void Main() { // Your code here } }
Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of students in good standing (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt). Enter ZZZ to Quit. This is in Java
In Python Calculator Write a program that allows the user to enter two numbers and then adds, subtracts, divides or multiplies them when the user clicks on the appropriate button. Make sure you have a Quit button. Modification and requirements”: _____Window title should be your name Calculate self.main_window.title("?????") _____Labels - change the attributes of the color, font, size and bold the answerExample self.label = tkinter.Label(self.main_window, \ text='?????????!', font=(" should Arial", 12, "bold"), fg="blue", bg="pink")Tip: choose a color from the...
Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program named GetIDAndAge that continually prompts the user for an ID number and an age until a terminal 0 is entered for both. If the ID and age are both valid, display the message ID and Age OK. Throw a DataEntryException if the ID is not in the range of valid ID numbers (0 through 999), or if the age is not in the range...
Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student’s grade point average is at least 2.0, output each record either to a file of students in good standing (located at StudentsGoodStanding.txt) or those on academic probation (located at StudentsAcademicProbation.txt).
(Write a program for C++ )that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is: Candidate Votes Received % of Total Votes Johnson 5000 25.91...
Find Bugs in the pseudocode// A high school is holding a recycling competition// This program allows a user to enter a student's // year in school (1 through 4)// and number of cans collected// Data is entered continuously until the user wnats to quit// After headings, output is four lines// one for each school year classstart Declarations num year num cans num SIZE = 4 num QUIT = 9 ...
Write a program in C++ that places a dog into a pen, which can hold up to four dogs, each time a key (i.e. Enter ) is pressed. Each Dog is an object instantiated from class Dog defined in file Dog.h. The Pen is an object instantiated from class Pen defined in file Pen.h. Each Dog object, when instantiated, randomly chooses a fur color (i.e.” black”, “brown” or “white”), an eye color (“brown”, “black”, or “blue”), breed (Labrador, German Shepherd,...
Write this in a C program please. Structures on Disk The Problem Your task is to write a program that stores and retrieves structures in a file on disk. The file of structures must remain on the disk once your program ends. You should be able to store structures to the file and retrieve from the file after restarting the program. The record that you will be writing to file has the following structure: struct contact {unsigned long phone_number; long...
You must assume that the data file and your four function subprograms are located inside the working directory (forder). Please write the main program and each of the four function subprograms. 1. The data in the following table are to be read from the file "grades.txt"and processed The grades are in percentages. The format of the data is shown below First Name ID Number Last Name Grades 001AA Tam 78.50 oe 86.45 001AB Gabriel Stuart Thus, there are 4 columns...