A parking garage has two types of customers: members and non-members. During week working days, Sunday to Thursday, members use the parking for free and non-members pay BD 0.300 per hour. However, during the weekend, Friday and Saturday, all type of customers pay BD 0.200 per hour. Write a Java program that prompts the user to enter a day (int) followed by the number of parking hours double) and a member code (char) 'M' or 'm' for members and any other character for non-menmbers. Your program should then calculate and print the total charges. For the days, use 1 for Sunday, 2 for Monday, etc. Note: For any invalid day or hours print an appropriate invalid message and exit the program. Sample Run 1 Sample Run 2 Sample Run 3 Enter day, hours and member code: 6 4.5 M Enter day, hours and member code; 2 5.0 M Enter day, hors and member code: 3 5.25 N Total charges: BD 0,900 Total charges: BD 0.000 Tolal charges: BD 1575
A parking garage has two types of customers: members and non-members. During week working days, Sunday to Thursday, members use the parking for free and non-members pay BD 0.300 per hour. However, during the weekend, Friday and Saturday, all type of customers pay BD 0.200 per hour. Write a Java program that prompts the user to enter a day (int) followed by the number of parking hours double) and a member code (char) 'M' or 'm' for members and any other character for non-menmbers. Your program should then calculate and print the total charges. For the days, use 1 for Sunday, 2 for Monday, etc. Note: For any invalid day or hours print an appropriate invalid message and exit the program. Sample Run 1 Sample Run 2 Sample Run 3 Enter day, hours and member code: 6 4.5 M Enter day, hours and member code; 2 5.0 M Enter day, hors and member code: 3 5.25 N Total charges: BD 0,900 Total charges: BD 0.000 Tolal charges: BD 1575
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
Related questions
Topic Video
Question
Java 1
![A parking garage has two types of customers: members and non-members. During week working days, Sunday to
Thursday, members use the parking for free and non-members pay BD 0.300 per hour. However, during the weekend,
Friday and Saturday, all type of customers pay BD 0.200 per hour.
Write a Java program that prompts the user to enter a day (Int) followed by the number of parking hours (double)
and a member code (char) 'M' or 'm' for members and any other character for non-members. Your program should
then calculate and print the total charges. For the days, use 1 for Sunday, 2 for Monday, etc. Note: For any invalid
day or hours print an appropriate invalid message and exit the program.
Sample Run 1
Enter day, hours and member code:
6 4.5 M
Sample Run 2
Sample Run 3
Enter day, hours and member code;
2 5.0 M
Enter day, hours and member code:
3 5.25 N
Total charges: BD 0,900
Total charges: BD 0.000
Total charges: BD 1.575
bers
mem ber
non- n m
M
free
howA メo3~
charges
larges](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7b83b0b1-24b6-4d28-90eb-0afd168c64a9%2Fc085b7a0-0534-4618-9d0e-10ba34ab6b5b%2F6supbo6_processed.jpeg&w=3840&q=75)
Transcribed Image Text:A parking garage has two types of customers: members and non-members. During week working days, Sunday to
Thursday, members use the parking for free and non-members pay BD 0.300 per hour. However, during the weekend,
Friday and Saturday, all type of customers pay BD 0.200 per hour.
Write a Java program that prompts the user to enter a day (Int) followed by the number of parking hours (double)
and a member code (char) 'M' or 'm' for members and any other character for non-members. Your program should
then calculate and print the total charges. For the days, use 1 for Sunday, 2 for Monday, etc. Note: For any invalid
day or hours print an appropriate invalid message and exit the program.
Sample Run 1
Enter day, hours and member code:
6 4.5 M
Sample Run 2
Sample Run 3
Enter day, hours and member code;
2 5.0 M
Enter day, hours and member code:
3 5.25 N
Total charges: BD 0,900
Total charges: BD 0.000
Total charges: BD 1.575
bers
mem ber
non- n m
M
free
howA メo3~
charges
larges
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education