You are the manager of Desert State Park. You will create a program to calculate thecamping fees
Question:
You are the manager of Desert State Park. You will create a program to calculate thecamping fees for each camper.
Program Specifications:
a. Create a folder named Nested If Program 01. Save the Java file as a state park.
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 beentered from the keyboard. This program will process one record and only one record at atime.
c. The camping fees are determined as follows: If the camper is a state resident, the cost forthe first seven days is 7.95 per day. After seven days, the cost drops to 5.95 per day. If thecamper is a non-resident of the state, the cost is 9.95 per day, regardless of the number ofdays. 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 isprinted for the residency.
d. The output will consist camper’s name, the residency words (Resident, Non-Resident, orUnknown), 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 columnheading identifying the data. There should be blank lines between the input data and theoutput data that is displayed on the screen.
e. You decided on the appropriate data types and variable names. Named constants mustbe used in the program. This program should contain only one nested if statement.
Managerial Economics and Business Strategy
ISBN: 978-0071267441
7th Edition
Authors: Michael R. baye