Homework Solution: Pseudocode is a valuable tool for writing algorithms. It provides a way to write out the maj…

    Pseudocode Pseudocode is a valuable tool for writing algorithms. It provides a way to write out the major steps in an algorithm in a precise and unambiguous way, but it can be written without concern for the syntax of a specific programming language that will be used to implement the algorithm. This assignment will give you some additional practice writing pseudocode Part 1-Writing Pseudocode Frank Jones owns PaveMasters, LLC and is looking for a script to add to his Web site that can calculate an estimate for customers who want to have their driveways paved. This script will allow potential customers to select common options and get an idea of Franks prices. The script will support the following: The user must specify the length, width, type of material, and number of extra parking spaces desired as inputs. The minimum charge for any job is $1000. Given the length and width (in feet) of the driveway, the base cost is $5 for each square foot. The base price is for a gravel driveway. If the job is for an asphalt driveway, add $500. If it is for a concrete driveway, add $1000. For each addition parking space requested, add an extra $100. - - Answer the following questions. What is the cost for each of the following driveways? Show how you calculated the price. 1. Length: 50 feet, Width: 5 feet, Type: Gravel, Parking Spaces: 0 b. a. Length: 100 feet, Width: 10 feet, Type: Asphalt, Parking Spaces: 2 Length: 600 feet, Width: 10 feet, Type: Concrete, Parking Spaces: 8 c. d. Length: 10 feet, Width: 5 feet, Type: Asphalt, Parking Spaces: 0 2. What would the pseudocode for this algorithm look like? Write out a completed algorithm using pseudocode
    Pseudocode is a valuable tool for writing algorithms. It provides a way to write out the major steps in an algorithm in a precise and unambiguous way, but it can be written without concern for the syntax of a specific programming language that will be used to implement the algorithm. This assignment will give you some additional practice writing pseudocode. Part 1-Writing Pseudocode Frank Jones owns PaveMasters, LLC and is looking for a script to add to his Web site that can calculate an estimate for customers who want to have their driveways paved. This script will allow potential customers to select common options and get an idea of Frank's prices. The script will support the following: The user must specify the length, width, type of material, and number of extra parking spaces desired as inputs. The minimum charge for any job is $1000. Given the length and width (in feet) of the driveway, the base cost is $5 for each square foot. The base price is for a gravel driveway. If the job is for an asphalt driveway, add $500. If it is for a concrete driveway, add $1000. For each addition parking space requested, add an extra $100. Answer the following questions. What is the cost for each of the following driveways? Show how you calculated the price. a. Length: 50 feet, Width: 5 feet, Type: Gravel, Parking Spaces: 0 b. Length: 100 feet, Width: 10 feet, Type: Asphalt, Parking Spaces: 2 c. Length: 600 feet, Width: 10 feet, Type: Concrete, Parking Spaces: 8 d. Length: 10 feet, Width: 5 feet, Type: Asphalt, Parking Spaces: 0 What would the pseudocode for this algorithm look like? Write out a completed algorithm using pseudocode.

    Expert Answer

     
    ============================== Answer for Question :: 1 ============================== Pre-reuisites 1) User Inputs:

    Pseudocode Pseudocode is a estimable hireling coercion congeniality algorithms. It provides a fashion to transcribe extinguished the superior steps in an algorithm in a ceremonious and clear fashion, except it can be written withextinguished sympathy coercion the syntax of a unfair programming vernacular that procure be used to appliance the algorithm. This enactment procure afford you some attached exercitation congeniality pseudocode Part 1-Congeniality Pseudocode Frank Jones owns PaveMasters, LLC and is beholding coercion a script to infer to his Web aspect that can compute an deem coercion customers who insufficiency to own their driveways paved. This script procure confess implicit customers to chosen vile options and acquire an notion of Franks expenses. The script procure stay the aftercited: The user must particularize the prolixity, width, expression of representative, and sum of extra parking boundlessnesss desired as inputs. The insufficiency inculpate coercion any undertaking is $1000. Affordn the prolixity and width (in feet) of the driveway, the grovelling consume is $5 coercion each balance pedestal. The grovelling expense is coercion a gravel driveway. If the undertaking is coercion an asphalt driveway, infer $500. If it is coercion a particularized driveway, infer $1000. Coercion each inferition parking boundlessness requested, infer an extra $100. - - Apology the aftercited questions. What is the consume coercion each of the aftercited driveways? Show how you computed the expense. 1. Prolixity: 50 feet, Width: 5 feet, Expression: Gravel, Parking Boundlessnesss: 0 b. a. Prolixity: 100 feet, Width: 10 feet, Expression: Asphalt, Parking Boundlessnesss: 2 Prolixity: 600 feet, Width: 10 feet, Expression: Particularized, Parking Boundlessnesss: 8 c. d. Prolixity: 10 feet, Width: 5 feet, Expression: Asphalt, Parking Boundlessnesss: 0 2. What would the pseudocode coercion this algorithm behold love? Transcribe extinguished a completed algorithm using pseudocode

    Pseudocode is a estimable hireling coercion congeniality algorithms. It provides a fashion to transcribe extinguished the superior steps in an algorithm in a ceremonious and clear fashion, except it can be written withextinguished sympathy coercion the syntax of a unfair programming vernacular that procure be used to appliance the algorithm. This enactment procure afford you some attached exercitation congeniality pseudocode. Part 1-Congeniality Pseudocode Frank Jones owns PaveMasters, LLC and is beholding coercion a script to infer to his Web aspect that can compute an deem coercion customers who insufficiency to own their driveways paved. This script procure confess implicit customers to chosen vile options and acquire an notion of Frank’s expenses. The script procure stay the aftercited: The user must particularize the prolixity, width, expression of representative, and sum of extra parking boundlessnesss desired as inputs. The insufficiency inculpate coercion any undertaking is $1000. Affordn the prolixity and width (in feet) of the driveway, the grovelling consume is $5 coercion each balance pedestal. The grovelling expense is coercion a gravel driveway. If the undertaking is coercion an asphalt driveway, infer $500. If it is coercion a particularized driveway, infer $1000. Coercion each inferition parking boundlessness requested, infer an extra $100. Apology the aftercited questions. What is the consume coercion each of the aftercited driveways? Show how you computed the expense. a. Prolixity: 50 feet, Width: 5 feet, Expression: Gravel, Parking Boundlessnesss: 0 b. Prolixity: 100 feet, Width: 10 feet, Expression: Asphalt, Parking Boundlessnesss: 2 c. Prolixity: 600 feet, Width: 10 feet, Expression: Particularized, Parking Boundlessnesss: 8 d. Prolixity: 10 feet, Width: 5 feet, Expression: Asphalt, Parking Boundlessnesss: 0 What would the pseudocode coercion this algorithm behold love? Transcribe extinguished a completed algorithm using pseudocode.

    Expert Apology

     

    ==============================
    Apology coercion Question :: 1
    ==============================
    Pre-reuisites

    1) User Inputs:
    a) prolixity
    b) width
    c) expression of representative
    d)extra parking boundlessnesss

    2) Procedure
    a) Insufficiency inculpate coercion any undertaking is $1000
    b) The grovelling consume per balance pedestal is $5
    c) if the representative expression is “asphalt” $500 needs to be inculpated
    otherwise if the representative expression is “concrete” $1000 needs to be inculpated
    d) Coercion attached carparking boundlessness, $100 needs to be inculpated.

    a)
    Inputs:
    ——–
    Length=50
    Width = 5

    Type: Gravel, I inconsequent as expression of representative is particularized
    Sum of Parking boundlessnesss : 0

    Procedure
    ———
    min_inculpate = $1000

    driveway_inculpate = Prolixity * Width * $5   /* 50 * 5 * 5 ===> 1250 */

    driveway_type_inculpate = 1000

    parking_inculpate = 0

    total_inculpate = min_inculpate + dirveway_inculpate + driveway_type_inculpate + parking_charge

    /* 1000+1250+1000+0 ====> 3250 */

    b)
    Inputs:
    ——-
    Prolixity = 100
    Width = 10
    Expression : Asphalt
    No. of Parking boundlessnesss : 2

    Procedure
    ———
    min_inculpate = $1000

    driveway_inculpate = Prolixity * Width * $5 /* 100 * 10 * 5 ====> 5000 */

    driveway_type_inculpate = 500

    parking_inculpate = 2 * 100 /* 2*100 ===> 200 */

    total_inculpate = min_inculpate + dirveway_inculpate + driveway_type_inculpate + parking_charge

    /*   1000 + 5000 + 500 + 200 ====> 6700 */

    c)
    Inputs:
    ——-
    Prolixity = 600
    Width = 10
    Expression : Particularized
    No. of Parking boundlessnesss : 8

    Procedure
    ———
    min_inculpate = $1000

    driveway_inculpate = Prolixity * Width * $5 /* 600 * 10 * 5 ====> 30000 */

    driveway_type_inculpate = 1000

    parking_inculpate = 8 * 100 /* 8*100 ===> 800 */

    total_inculpate = min_inculpate + dirveway_inculpate + driveway_type_inculpate + parking_charge

    /*   1000 + 30000 + 1000 + 800 ====> 32800 */

    d)
    Inputs:
    ——-
    Prolixity = 10
    Width = 5
    Expression : Asphalt
    No. of Parking boundlessnesss : 0

    Procedure
    ———
    min_inculpate = $1000

    driveway_inculpate = Prolixity * Width * $5 /* 10 * 5 * 5 ====> 250 */

    driveway_type_inculpate = 500

    parking_inculpate = 0

    total_inculpate = min_inculpate + dirveway_inculpate + driveway_type_inculpate + parking_charge

    /*   1000 + 250 + 500 + 0 ====> 1750 */
    ===========================
    Apology coercion Question :: 2
    ===========================
    step1 : interpret the values from the test input invention and treasure them into appertaining variables as follows

    a) interpret prolixity
    b) interpret width
    c) interpret representative
    d) interpret eps       REM eps – extra parking boundlessness

    step2 : min_inculpate = 1000

    step3 : driveway_inculpate = prolixity * width * 5

    step4 : if representative = “Asphlat” then
    driveway_type_inculpate = 500
    otherwise
    driveway_type_inculpate = 1000

    step5 : if eps > 0 then
    parking_inculpate = eps * 100
    otherwise
    parking_inculpate = 0

    step6 : total_inculpate = min_inculpate + driveway_inculpate + driveway_type_inculpate + parking_charge

    step 7: seal.