You are the manager of the Desert State Park. You will create a program to calculate the camping fees for each camper. Program Specifications: a. Create a folder named Nested If Program 01. Save the Java file as StatePark. b. Input consists of the camper’s name, residency code (R - Resident or N - Non-resident), and the number of days camping. Sample input is illustrated on page 2. Input will be entered from the keyboard. This program will process one record and only one record at a time. c. The camping fees are determined as follows: If the camper is a state resident, the cost for the first seven days is 7.95 per day. After seven days, the cost drops to 5.95 per day. If the camper is a non-resident of the state, the cost is 9.95 per day, regardless of the number of days. If there is an error in the input record and the residency code contains neither an R (resident) nor an N (non-resident), the cost is 12.95 per day and the value UNKNOWN is printed for the residency. d. The output will consist camper’s name, the residency words (Resident, Non-Resident, or Unknown), days camping, and the total camping fee. Display the fees with a dollar sign. The data displayed on the screen should be written on separate lines with a column heading identifying the data. There should be blank lines between the input data and the output data that is displayed on the screen. e. You decided on the appropriate data types and variable names. Named constants must be used in the program. This program should contain only one nested if statement.

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

You are the manager of the Desert State Park. You will create a program to calculate the
camping fees for each camper.

Program Specifications:

a. Create a folder named Nested If Program 01. Save the Java file as StatePark.

b. Input consists of the camper’s name, residency code (R - Resident or N - Non-resident),
and the number of days camping. Sample input is illustrated on page 2. Input will be
entered from the keyboard. This program will process one record and only one record at a
time.

c. The camping fees are determined as follows: If the camper is a state resident, the cost for
the first seven days is 7.95 per day. After seven days, the cost drops to 5.95 per day. If the
camper is a non-resident of the state, the cost is 9.95 per day, regardless of the number of
days. If there is an error in the input record and the residency code contains neither an R
(resident) nor an N (non-resident), the cost is 12.95 per day and the value UNKNOWN is
printed for the residency.

d. The output will consist camper’s name, the residency words (Resident, Non-Resident, or
Unknown), days camping, and the total camping fee. Display the fees with a dollar sign.
The data displayed on the screen should be written on separate lines with a column
heading identifying the data. There should be blank lines between the input data and the
output data that is displayed on the screen.

e. You decided on the appropriate data types and variable names. Named constants must
be used in the program. This program should contain only one nested if statement.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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
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