quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-15

السؤال

Transcribed Image Text:

Class Account Private Data Members: static int genId int patientID double balance int daysInHospital SurgeryType surType string name int age char gender Public Member Functions: PatientAccount() PatientAccount(int p_id, double bal, in daysInHospital,SurgeryType surType, string name, int age, char gender) Public Member Functions: void setPatientId (int x) void setBalance(double x) void setDaysInHospital(int x) void setSurType(SurgeryType x) void setName(string x) void setAge(int x) void setGender(char x) Public Member Functions: int getPatientId () double getBalance() int getDaysInHospital() SurgeryType getSurType() string getName() int getAge() char getGender() Public Member Functions: double calculateBalance() vold reportSummary() Static data member used to assign value to patientID; Account ID Current Balance of the patientAccount Number of days in hospital Type of surgery Name of Patient Age of Patient Gender of Patient Constructors: Default Constructor (no parameters) Overloaded Constructor: Three-Parameter Constructor Setters: (Make sure input is validated) Function sets patient id to x. Function sets patient balance to x Function sets days in hospital to x Function sets surgery type to x Function sets patient name to x Function sets patient age to x Function sets patient gender to x Getters: Function returns patient ID. Function returns patient account balance. Function returns days in hospital. Function returns surgery type. Function returns patient name. Function returns patient age Function returns patient gender Function calculates and returns the patient account balance. Function displays a summary of all the patientAccount information. Write a program that creates an array of 5 PatientAccount objects. Main Program: (35%) The program should ask the user to select an account number from 0-4 (0: 100, 1: 200, 2: 300, 3: 400 and 4: 500) or -1 to exit the program. After selecting an account number, the user should be presented with the following menu options: • Enter 1 to select the type of surgery performed o Choices are Liposuction, Nose Reshaping, Eyelid Surgery and Tummy Tuck Enter 2 Calculate and Display the patient account balance Enter 3 Display the Patient Summary Report Enter 99 to exit to the main menu to select another account number When creating each PatientAccount object, make sure that each object is initialized in both the default and overloaded constructor functions with the following guidelines: Use the static data member to initialize the patientID. Patient ID must be. initialized with multiples of 100 starting with 100. (5%) The starting balance of each PatientAccount object should be created from a random number generator function returning values between 100.00 and 2000.00. (5%) • Use: enum Surgery Type (LIPOSUCTION.NOSE RESHAPING, EYELID SURGERY, TUMMY TUCK); (5%) The cost of surgery types is as follows: Liposuction = $2,500.00 Nose Reshaping = $6,000.00 • Eyelid Surgery = $2,450.00 o Tummy Tuck = $12,900.00 NOTE: No non-constant global variables are to be used in the program

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top