Praveen who is working as Reservation Manager, asks for help from the development team to build a code that calculates the total cost to be charged on the customer by considering the date of Booking, date of vacating the hall, and cost per day. Imagine you are working in the development team and this task is assigned to you. Write a program to calculate the total amount charged by the Hall Manager. Create a class Hall in ‘Hall.py’ with the following variables. DataType Variable start_date Date end_date Date cost_per_day int Use _init_() constructor to initialize the variables with respect to class. Use a 3 Argument constructor (start_date, end_date, cost_per_day). Use the following methods in Hall class to perform the corresponding operation. Method Description no_days(self) This method is used to calculate the number of days Item (say Hall) booked or used. cost(self,d) Calculate the Total amount for Item (say Hall). Where ‘d’ is a number of days that is been calculated. (Call this method inside the no_days() method). Note: The format of the date is "Jul 1 2014" (without quotes). Input Format: The first line of the input is the Start date The Second line of the input is the end date. The Third line of input consists of cost per day. Output Format: Display the number of days of stay and the total cost to be charged with the customer. Refer to sample input and output for formatting specifications. Note : → Output statements should be printed inside the Hall class and not in the Main class. → no_days() method should be called from the Main class and the cost() method should be called from no_days() method. All text in bold corresponds to input and the rest corresponds to output. Sample Input-Output: Enter Start time Dec 25 2017 Enter the End time Dec 27 2017 Enter the cost per day 1500 Total number of days 2 Total cost 3000

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Praveen who is working as Reservation Manager, asks for help from the development team to build a code that calculates the total cost to be charged on the customer by considering the date of Booking, date of vacating the hall, and cost per day. Imagine you are working in the development team and this task is assigned to you. Write a program to calculate the total amount charged by the Hall Manager.
Create a class Hall in ‘Hall.py’ with the following variables.

DataType Variable
start_date Date
end_date Date
cost_per_day int

Use _init_() constructor to initialize the variables with respect to class.

Use a 3 Argument constructor (start_date, end_date, cost_per_day).
Use the following methods in Hall class to perform the corresponding operation.

Method Description
no_days(self) This method is used to calculate the number of days Item (say Hall) booked or used.
cost(self,d) Calculate the Total amount for Item (say Hall). Where ‘d’ is a number of days that is been calculated. (Call this method inside the no_days() method).

Note:
The format of the date is "Jul 1 2014" (without quotes).

Input Format:
The first line of the input is the Start date
The Second line of the input is the end date.
The Third line of input consists of cost per day.

Output Format:
Display the number of days of stay and the total cost to be charged with the customer.
Refer to sample input and output for formatting specifications.

Note :
→ Output statements should be printed inside the Hall class and not in the Main class.
→ no_days() method should be called from the Main class and the cost() method should be called from no_days() method.

All text in bold corresponds to input and the rest corresponds to output.

Sample Input-Output:
Enter Start time
Dec 25 2017
Enter the End time
Dec 27 2017
Enter the cost per day
1500

Total number of days 2
Total cost 3000

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education