C PROGRAMMING Nested If with Loops - Program #2 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...

not sure how to do this


C PROGRAMMING Nested If with Loops - Program #2 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 Loop Program 02. Copy the StatePark.java file from the Nested IF Program 02 folder. Paste it in the new folder. Open the java file and edit the public line to StateParkLoop. Save the Java file as StateParkLoop. You will edit the program to add a loop and final totals. b. Input consists of the camper’s name, residency code (R or r for Resident or N or n for 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 multiple records. Residency code must be defined as a char and both uppercase and lowercase should be tested. c. This program must also contain a loop which will allow you to enter as many records as needed. The determination of whether to enter the loop should be in the form of a question. d. 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 or r (resident) nor an N or n (non-resident), the cost is 12.95 per day and the value UNKNOWN is printed for the residency. e. Final totals must be calculated for the total campers, total resident campers, total non- resident campers, total unknown campers, total fees for resident campers, total fees for non-resident campers, total fees for unknown campers, and total fees for all campers. f. 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. Sample output is shown on the next page. It shows what the output should look like when printed. g. After all records have been processed, final totals will be printed. Final totals will be printed once. All fees should be printed with a dollar sign. h. 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. i. Zip the folder and submit in Canvas. SAMPLE INPUT NAME RESIDENCY CODE DAYS CAMPING Jack Henry R 3 Don James R 8 Bill Donald N 9 Ralph Adams F 6 Murray Frank R 7 Toni Jones N 3 Mary Smith R 10 Thomas Adams X 2 SAMPLE OUTPUT DESERT STATE PARK Camper’s Name: XXXXXXXXXXXXXXXXXXX Residency: Resident or Non-Resident or Unknown Days Camping: 99 Camping Fees: $999.99 (Final totals will be printed once. After all records have been processed). Total Campers: 99 Total Resident Campers: 99 Total Non-Resident Campers: 99 Total Unknown Campers: 99 Total Resident Fees: $999.99 Total Non-Resident Fees: $999.99 Total Unknown Fees: $999.99 Total All-Campers Fees: $999.99
Apr 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here