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
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.
Step by Step Solution
3.37 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
In this program I have created a function called camping cost and it will return the cost as per the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started