Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the decision structure pseudocode for the following; 1. If the contract

ID: 3623576 • Letter: C

Question

Complete the decision structure pseudocode for the following;

1. If the contract number is not between 10000 and 99999 inclusive, issue an error message and end the program.
2. The insurance indicator must be “Y” or “N” (for “Yes” or “No”); otherwise, display an error message and assume “Y”.
3. If all the entered data is valid, display it along with the fee for the rental, which is calculated as follows:
1. $25 per day for 10 days or fewer
2. $18 per day for each day over 10 days
3. $2.50 per day for insurance, regardless of the number of days in the contract

Explanation / Answer

please rate - thanks

hope these are good, everyone does pseudocode differently

1. If the contract number is not between 10000 and 99999 inclusive, issue an error message and end the program.

          contract number < 10000 or contract number >99999
                                    true: error message
                                            exit program
                                    false: continue execution


2. The insurance indicator must be “Y” or “N” (for “Yes” or “No”); otherwise, display an error message and assume “Y”.

                                                  indicator not equal Y and indicator not equal N
                                                                       true: error message
                                                                                  indicator = Y
                                                                                 continue execution
                                                                     false: continue execution

3. If all the entered data is valid, display it along with the fee for the rental, which is calculated as follows:
1. $25 per day for 10 days or fewer
2. $18 per day for each day over 10 days
3. $2.50 per day for insurance, regardless of the number of days in the contract

                                                  enter number of days
                                                  days < = 10
                                                              true: fee=25*10
                                                              false: fee=25*10+18 *(days-10)
                                                  insurance = 2.5 * days
                                                  output:     days, fee, insurance