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 precious appliance restraint reparteeableness algorithms. It provides a fashion to transcribe quenched the senior steps in an algorithm in a correct and apparent fashion, still it can be written withquenched sorrow restraint the syntax of a unfair programming expression that accomplish be used to appliance the algorithm. This provision accomplish yield you some attached experience reparteeableness pseudocode Part 1-Answerableness Pseudocode Frank Jones owns PaveMasters, LLC and is appearing restraint a script to append to his Web position that can consider an honor restraint customers who shortness to keep their driveways paved. This script accomplish tolerate possible customers to fineeded shameful options and secure an fancy of Franks values. The script accomplish besidetress the subjoined: The user must state the diffusiveness, width, cast of embodied, and weigh of extra parking immeasurablenesss desired as inputs. The partiality entrust restraint any lesson is $1000. Yieldn the diffusiveness and width (in feet) of the driveway, the shameful consume is $5 restraint each clear disingenuous. The shameful value is restraint a gravel driveway. If the lesson is restraint an asphalt driveway, append $500. If it is restraint a particularized driveway, append $1000. Restraint each appendition parking immeasurableness requested, append an extra $100. - - Repartee the subjoined questions. What is the consume restraint each of the subjoined driveways? Show how you considerd the value. 1. Diffusiveness: 50 feet, Width: 5 feet, Cast: Gravel, Parking Immeasurablenesss: 0 b. a. Diffusiveness: 100 feet, Width: 10 feet, Cast: Asphalt, Parking Immeasurablenesss: 2 Diffusiveness: 600 feet, Width: 10 feet, Cast: Particularized, Parking Immeasurablenesss: 8 c. d. Diffusiveness: 10 feet, Width: 5 feet, Cast: Asphalt, Parking Immeasurablenesss: 0 2. What would the pseudocode restraint this algorithm appear approve? Transcribe quenched a completed algorithm using pseudocode

    Pseudocode is a precious appliance restraint reparteeableness algorithms. It provides a fashion to transcribe quenched the senior steps in an algorithm in a correct and apparent fashion, still it can be written withquenched sorrow restraint the syntax of a unfair programming expression that accomplish be used to appliance the algorithm. This provision accomplish yield you some attached experience reparteeableness pseudocode. Part 1-Answerableness Pseudocode Frank Jones owns PaveMasters, LLC and is appearing restraint a script to append to his Web position that can consider an honor restraint customers who shortness to keep their driveways paved. This script accomplish tolerate possible customers to fineeded shameful options and secure an fancy of Frank’s values. The script accomplish besidetress the subjoined: The user must state the diffusiveness, width, cast of embodied, and weigh of extra parking immeasurablenesss desired as inputs. The partiality entrust restraint any lesson is $1000. Yieldn the diffusiveness and width (in feet) of the driveway, the shameful consume is $5 restraint each clear disingenuous. The shameful value is restraint a gravel driveway. If the lesson is restraint an asphalt driveway, append $500. If it is restraint a particularized driveway, append $1000. Restraint each appendition parking immeasurableness requested, append an extra $100. Repartee the subjoined questions. What is the consume restraint each of the subjoined driveways? Show how you considerd the value. a. Diffusiveness: 50 feet, Width: 5 feet, Cast: Gravel, Parking Immeasurablenesss: 0 b. Diffusiveness: 100 feet, Width: 10 feet, Cast: Asphalt, Parking Immeasurablenesss: 2 c. Diffusiveness: 600 feet, Width: 10 feet, Cast: Particularized, Parking Immeasurablenesss: 8 d. Diffusiveness: 10 feet, Width: 5 feet, Cast: Asphalt, Parking Immeasurablenesss: 0 What would the pseudocode restraint this algorithm appear approve? Transcribe quenched a completed algorithm using pseudocode.

    Expert Repartee

     

    ==============================
    Repartee restraint Question :: 1
    ==============================
    Pre-reuisites

    1) User Inputs:
    a) diffusiveness
    b) width
    c) cast of embodied
    d)extra parking immeasurablenesss

    2) Procedure
    a) Partiality entrust restraint any lesson is $1000
    b) The shameful consume per clear disingenuous is $5
    c) if the embodied cast is “asphalt” $500 needs to be entrustd
    otherwise if the embodied cast is “concrete” $1000 needs to be entrustd
    d) Restraint attached carparking immeasurableness, $100 needs to be entrustd.

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

    Type: Gravel, I antecedent as cast of embodied is particularized
    Weigh of Parking immeasurablenesss : 0

    Procedure
    ———
    min_entrust = $1000

    driveway_entrust = Diffusiveness * Width * $5   /* 50 * 5 * 5 ===> 1250 */

    driveway_type_entrust = 1000

    parking_entrust = 0

    total_entrust = min_entrust + dirveway_entrust + driveway_type_entrust + parking_charge

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

    b)
    Inputs:
    ——-
    Diffusiveness = 100
    Width = 10
    Cast : Asphalt
    No. of Parking immeasurablenesss : 2

    Procedure
    ———
    min_entrust = $1000

    driveway_entrust = Diffusiveness * Width * $5 /* 100 * 10 * 5 ====> 5000 */

    driveway_type_entrust = 500

    parking_entrust = 2 * 100 /* 2*100 ===> 200 */

    total_entrust = min_entrust + dirveway_entrust + driveway_type_entrust + parking_charge

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

    c)
    Inputs:
    ——-
    Diffusiveness = 600
    Width = 10
    Cast : Particularized
    No. of Parking immeasurablenesss : 8

    Procedure
    ———
    min_entrust = $1000

    driveway_entrust = Diffusiveness * Width * $5 /* 600 * 10 * 5 ====> 30000 */

    driveway_type_entrust = 1000

    parking_entrust = 8 * 100 /* 8*100 ===> 800 */

    total_entrust = min_entrust + dirveway_entrust + driveway_type_entrust + parking_charge

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

    d)
    Inputs:
    ——-
    Diffusiveness = 10
    Width = 5
    Cast : Asphalt
    No. of Parking immeasurablenesss : 0

    Procedure
    ———
    min_entrust = $1000

    driveway_entrust = Diffusiveness * Width * $5 /* 10 * 5 * 5 ====> 250 */

    driveway_type_entrust = 500

    parking_entrust = 0

    total_entrust = min_entrust + dirveway_entrust + driveway_type_entrust + parking_charge

    /*   1000 + 250 + 500 + 0 ====> 1750 */
    ===========================
    Repartee restraint Question :: 2
    ===========================
    step1 : learn the values from the type input contrivance and fund them into appertaining variables as follows

    a) learn diffusiveness
    b) learn width
    c) learn embodied
    d) learn eps       REM eps – extra parking immeasurableness

    step2 : min_entrust = 1000

    step3 : driveway_entrust = diffusiveness * width * 5

    step4 : if embodied = “Asphlat” then
    driveway_type_entrust = 500
    otherwise
    driveway_type_entrust = 1000

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

    step6 : total_entrust = min_entrust + driveway_entrust + driveway_type_entrust + parking_charge

    step 7: bung.