Question: CS 1 5 9 - HW # 0 2 Problem: A residential development begins with homes alternating on half - lot and full - lots.

CS 159- HW #02
Problem: A residential development begins with homes alternating on half-lot and full-lots. The first address is at 100
and is a half-lot. The next lot is a full-lot with an address of 101. Continuing this alternating series of half-lots and full-
lots the third home would be at address 103 on a half-lot. There is no address 102.
Neighboring homes share a single driveway along the border of the adjacent properties. The first driveway, shared by the
homes at 100 and 101, would enter from North Road while the second driveway, shared by homes at 103 and 104, would
enter from the South Road. A similar alternating direction of entry onto the properties continues through the development.
Given an address and the dimensions of a full lot, determine whether the lot is a half-lot (' H ') or full-lot (' F ') and the road
to which the driveway is connected, either North Road (' N ') or South Road (' S '). Lastly, display the lot size which is the
area for a full-lot and half of the area for a half-lot.
The address given will be no less than 100. Addresses such as 102 are invalid, see the example executions that follow for
a demonstration of how to handle invalid addresses.
Your program must accept input and produce output that matches exactly to the given executions.
Example Execution #1:
Enter property address ->100
Enter property length ->5
Enter property width ->5
Property Type: H
Drive Entry: N
Lot Size: 12.5
Example Execution #3(invalid address):
Enter property address ->102
Enter property length ->>44
Enter property width ->55
Property Type: I
Drive Entry: I
Lot Size: 0.0
Example Execution #2:
Enter property address ->101
Enter property width ->5
Property Type: F
Drive Entry: N
Lot Size: 25.0
Example Execution #4:
Enter property address ->110
Enter property length ->4.1
Enter property width ->10.2
Property Type: F
Drive Entry: S
Lot Size: 41.8
All course programming and documentation standards are in effect for this and each
assignment this semester. Please review this document!
Additional Requirements:
Each of the example executions provided for your reference represents a single execution of the program.
Your program must accept input and produce output exactly as demonstrated in the example executions, do not
add any "bonus" features not demonstrated in the example executions. Your program will be tested with the data
seen in the example executions and an unknown number of additional tests making use of meaningful data.
The address will always be an integer (int) not less than 100.
The length and width dimensions of the property may be floating-point (float) data and will be positive.
Course standards prohibit the use of programming concepts beyond the material found in the first three chapters
of the book, notes, and lectures.
Any use of logical operators, relational operators, bool variables, or selection constructs is prohibited and
would violate requirements of this assignment resulting in no credit being awarded for your effort.
All code for this assignment will be placed inside of the main function.
Course Programming and Documentation Standards Reminders:
Indent all code found within the main function exactly two spaces.
Place a single space between all operators and operands.
Comment all variables to the right of each declaration. Declare only one variable per line.
comment to indicate the start of the local declaration and executable statement sections of the main function.
Select meaningful identifiers (names) for all variables in your program.
Maximize your use of symbolic/defined constants and minimize your use of literal constants in your program.
note: im not sure how to do without selection structures can you help me with this please? so theres a pattern to the lots, 100 and 101 are connected to the north rd.100 is a full lot and 101 is a half lot and 102 is skipped. same pattern for 103 and 104 but they are connected to the south road and 105 is skipped. so the pattern is full half (north) skip 1 then full half (south) skip 1. this goes on until lot 110 as seen in the example. use this pattern to create code that outputs the example without using selection structures

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 Programming Questions!