Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are writing a program that will take as input a home type , a length , and a width . Home types are: trailer,

You are writing a program that will take as input a home type, a length, and a width.

Home types are: "trailer", "bungalow", "two-storey"

Home type: bungalow

Lengths are from 20 feet to 72 feet (real estate still tends to use imperial measures)

Length:  48

Widths are from 8 feet to 27 feet

Width:  27

From this, you are to generate an insurance report (example printed line):

You are insuring a bungalow of 1296 square feet.

If any of the data is invalid (less than the minimum or maximum, or not one of the defined types) then you should print:

***INVALID DATA***

Note, however, if you are dealing with a trailer, you have to also check the following:

If the trailer is 40 feet in length or less, you are insuring it as a travel trailer, so your output might look like:

You are insuring a travel trailer of 320 square feet.

If it is more than 40 feet in length, it will look like this:

 

You are insuring a mobile home of 1152 square feet.

Remember, a two-storey has double the square feet.

You should employ a nested if structure to solve this problem.

Step by Step Solution

3.55 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

Property v The value of the determinant remains unaltered if to the elements of one row or colu... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Management For Decision Makers

Authors: Peter Atrill, Paul Hurley

2nd Canadian Edition

138011605, 978-0138011604

More Books

Students also viewed these Finance questions