Question
Assignment 4.2 Instructions Submit an electronic copy of the assignment to the Dropbox electronic copy must be in a compressed folder format. If you don't know honw to compress a folder there is a slep hy step tatorial in the Handouts Link that will help you to accoemplish this task. This assignment must be completed by the end of the class Create a class named Carl.can that meets the following requieements The class should be initialized with a consenactor containing the following parameters: Car make (ex. Toyota) Car model (ex. Corolla) Car year Car price (ensure that price amount m Loan period (ex. 60). The class should have properties ( methods for cakculating a monthly payment following this requiremenm t price amount must be equal or grester than zero, if not, price wst be set to mero.) have properties (get/set accessors) for any instanoe variables (class level variables). Provide If loan period is less or equal than 24 moths, AIR is raied at l 1% If loan period is less or equal thin 48 moed AIR is rred at 21 1% If loan period is less or equal than 60 moths, AR is rated ir 41 1% ·Amy Any loan period greater than 60 meds APR is rated at611% Formula for Monthly Payment is where P- principal r- interest rate per month (APR/12) n = total number ofmonths Provide a method to display Car Loan Indomsation in the following format: Car make Car model Car year Car Price
Explanation / Answer
Please find the code below :