## The following lab has 3 parts:1) Translate your algorithm from problem 3 from th

The following lab has 3 parts:1) Translate your algorithm from problem 3 from the Selection section (2nd section) of the attached lab.2) Translate your algorithm from problem 4 from the Selection section of the attached lab into C++.3) Translate your algorithm from problem 5 from the Selection section of the attached lab.Submit each of the C++ source files (.cpp files) in the submission location below. There should be three files.
Practice with Sequence
2. Write an algorithm that converts a linear measurement in feet and inches into meters. One inch is equivalent to 2.54 centimeters.
Algorithm:
Prompt user for LengthInFeet.
Get LengthInFeet.
Prompt user for LengthInInches.
Get LengthInInches.
LengthInMeters = ((LengthInFeet * 12) + LengthInInches) * 2.54 / 100.
Display LengthInMeters.
IPO Chart:
Input
LengthInFeet
LengthInInches
Processing
Get LengthInFeet and LengthInInches
Calculate ((LengthInFeet * 12) + LengthInInches) * 2.54 / 100
Save the result in LengthInMeters
Display LengthInMeters
Output
LengthInMeters
Test Data:
LengthInFeet
LengthInInches
LengthInMeters
Data set 1
5
10
1.778
Data set 2
38
7
11.7602
Data set 3
6
0
1.8288
Desk Check with first set of data
Step
LengthInFeet
LengthInInches
LengthInMeters
1
?
?
?
2
5
?
?
3
5
?
?
4
5
10
?
5
5
10
1.778
6
5
10
1.778
Desk Check with second set of data
Step
LengthInFeet
LengthInInches
LengthInMeters
1
?
?
?
2
38
?
?
3
38
?
?
4
38
7
?
5
38
7
11.7602
6
38
7
11.7602
Desk Check with third set of data
Step
LengthInFeet
LengthInInches
LengthInMeters
1
?
?
?
2
6
?
?
3
6
?
?
4
6
0
?
5
6
0
1.8288
6
6
0
1.8288
Practice with Selection
4. Write an algorithm that can be used to calculate the commission earned in a real estate transaction. The chart below describes the formulas used to calculate the commission.
Sales Price
Commission
Less than \$100000
5% of Sales Price
\$100000 to \$300000
\$5000 + 10% of Sales Price over \$100000
More than \$300000
\$25000 + 15% of Sales Price over \$300000
Algorithm:
Prompt user for SalesPrice.
Get SalesPrice.
If SalesPrice

Attachments:

You can leave a response, or trackback from your own site.
error: Content is protected !!