Concept explainers
Overloaded Hospital
Write a
• 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 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 reentered before being returned.
Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the total charges.
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Programming in C
Introduction To Programming Using Visual Basic (11th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
C Programming Language
Problem Solving with C++ (10th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- (Numerical) Write an assignment statement to calculate the nth term in an arithmetic sequence. This is the formula for calculating the value, v, of the nth term: v=a+(n1)d a is the first number in the sequence. d is the difference between any two numbers in the sequence.arrow_forwardUsernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function nameValidation which receives a String argument name. This function: has name String…arrow_forwardUsernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"]arrow_forward
- Usernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function registerName which receives a String username and it returns a string message. This…arrow_forwardMPI Lab Directions Write an MPI program, countprimes which will count the number of prime numbers in the numbers from 1 to n inclusive where n is a long integer. The value for n which should be set in the program using a constant should be 50,000. Each process will test its share of the cases. Each process should not print out any primes that it finds, but it should keep a running total. Before the process finishes, it should print out its ID number and its count of primes that it found. The master process should end with printing a total for the count of the number of primes and the total amount of time taken to find all the primes. Take a screenshot of the output for running this with 5 processes. Before submission, make sure you clean up the directories so that no miscellaneous files are kept around in the submission. (Grade would be deducted if useless files are found in the homework directories.) Include the source code, screenshot, and the Makefile in the submission. Your…arrow_forwardCar Service MaintenanceCreate a program for car service maintenance. Based on numbers of months / distance travelled, the system will recommend for doing service as well as the parts to be changed. Finally, the system may generate the cost of service and items to be replaced. Hint# You can input the car model, owner name, number of months and distance travelled. Create a service schedule. For example, Servicing after every 10,000 km travelled or 6 months whichever comes first. The system should then generate the cost of service and items to be replaced. Use a random generator to generate the invoice number which is the combination of the date and the random number. (Hint# https://docs.python.org/3/library/random.html)Use appropriate prompts to input data and to present the output.Make sure you have the ID and name mentioned in the Jupyter Notebook or Python fileUpload the jupyter doc, python code in the link providedarrow_forward
- name formatter on c# create an application that lets the user enter the following pieces of data: • the user’s first name • the user’s middle name • the user’s last name • the user’s preferred title (mr., mrs., ms., dr., etc.) assume the user has entered the following data: • first name: kelly • middle name: jane • last name: smith • title: ms. the application should have buttons that display the user’s name formatted in the following ways: ms. kelly jane smith kelly jane smith kelly smith smith, kelly jane, ms. smith, kelly jane smith, kellyarrow_forwardDomino's Time Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you ordered a lot of food from Domino's. Pizzas are $12, an order of pasta is $6, and chicken wings are $8. Write a function that asks the user how many of each food item they would like, and then print a response telling them what their order to- tal will be. The order total should be an integer. >>> dominosTime() How many pizzas do you want? 3 How many orders of pasta do you want? 2 How many orders of chicken wings do you want? 2 By ordering 3 pizzas, 2 orders of pasta, and 2 orders of chicken wings, your order total comes to $64.arrow_forwardFinancial Assistance Application Create the Financial Assistance Application. A non-governmental organization needs your application to calculate the amount of financial assistance for needy families. The formula is as follows: • If the annual household income is between $30,000 and $40,000 and the house- hold has at least three children, the amount is $1,000 per child. • If the annual household income is between $20,000 and $30,000 and the house- hold has at least two children, the amount is $1,500 per child. • If the annual household income is less than $20,000, the amount is $2,000 per child. Implement a function for this computation. The program asks for the household income and number of children for each applicant, printing the amount returned by your function. Use -1 as a sentinel value for the input. The program output should be formatted as shown in the Sample Run. Note: You must use at least one function in your code.arrow_forward
- Aq1arrow_forwardIntro to Python Programmingarrow_forwardRequirements You are required to write a program that calculates and prints the bill for Viti Telephone Company. The company offers two types of services: regular and premium: its rate very depending on the type of service. The rates are computed as follows: Regular Service $10.00 plus first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute Premium Service $25.00 plus Calls made from 6.00 AM to 6.00 PM, the first 75 minutes are free and charges over 75 minutes are $0.10 per minute. For Calls made from 6.00 PM to 6.00 AM, the first 100 minutes are free and charges for over 100 minutes are $0.05 per minute. Your program should prompt user to enter an account number, a service code (type char), and the number of minutes service was used. A service code of r or R means regular service; a service code p or P means premium service. Treat any other character as an error. Your program should output the account number, type of service number of minutes the telephone was used…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT