Question: this is a software testing question (JAVA) This program 'Laptoplns' computes the cost of a Laptop insurance (10 policy and outputs a value for the

this is a software testing question (JAVA)this is a software testing question (JAVA) This program 'Laptoplns' computes the

This program 'Laptoplns' computes the cost of a Laptop insurance (10 policy and outputs a value for the premium as denoted by p. It takes marks] two inputs of integer age and Char OS (Operating System) type. If the age entered is less than 16 or greater than 65 the program returns a premium of zero, i.e. p=0, as they are not allowed to be customers of this business. The input for the Char OS takes the form of 'W' for Windows, 'M' for Macintosh, and 'L' for Linux. If an incorrect value for the OS is entered, the program returns p=0. In general, the insurance premium is 100, i.e. p=100. However, if a person has a Windows laptop and whose age is between 16 and 25 then an extra 25 is added to the premium, p=125. If the person is aged between 40 and 60 (inclusive) and they have a Macintosh Laptop the premium falls by 10, p=90. If the person is aged between 61 and 65 inclusive the premium falls by 5, p=95 no matter which operating system they own. Code OS!='L')) Line No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public int laptop Ins (int age, char os) { int p; if ((age65) || (OS!='W' &&OS!='M' && p=0; else { p=100; if ((age=40) && (age=61) && (age

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!