We read your photo as:

Load AutoCAD Create the roof plan below using rectangle and line command. Write a QBasic program to enter names, Date of Birth, Place of Birth, State of Origin, Sex, Age You are to print out the hard copy of your source code.

Computer Science

ScanSolve AI Answer

Step-by-step solution

3 steps

Part 1: AutoCAD

a) Load AutoCAD.
This step involves launching the AutoCAD software on your computer.

b) Create the roof plan below using rectangle and line command.

  1. Calculate the coordinates of the internal points.

    The outer rectangle has a width of 12 mm12 \text{ mm} and a height of 5 mm5 \text{ mm}. Let's assume the bottom-left corner of the rectangle is at coordinates (0,0)(0,0).
    The central horizontal line segment of the roof plan is formed by the intersection of the diagonal lines. Due to the symmetry of the diagram, this central line will be at half the height of the rectangle, so y=52=2.5 mmy = \frac{5}{2} = 2.5 \text{ mm}.
    Let the left endpoint of this central line be PL=(xL,yL)P_L = (x_L, y_L) and the right endpoint be PR=(xR,yL)P_R = (x_R, y_L).
    The diagonal line from the bottom-left corner (0,0)(0,0) to PLP_L makes an angle of 60∘60^\circ with the bottom edge (x-axis).
    The slope of this line is tan⁡(60∘)=3\tan(60^\circ) = \sqrt{3}.
    The equation of this line is y=3xy = \sqrt{3}x.
    Since PLP_L lies on this line and yL=2.5 mmy_L = 2.5 \text{ mm}:

    2.5=3xL2.5 = \sqrt{3}x_L xL=2.53=2.533=536 mmx_L = \frac{2.5}{\sqrt{3}} = \frac{2.5\sqrt{3}}{3} = \frac{5\sqrt{3}}{6} \text{ mm}

    Numerically, xL≈1.443 mmx_L \approx 1.443 \text{ mm}.
    So, the left internal point is PL=(536,2.5)P_L = \left(\frac{5\sqrt{3}}{6}, 2.5\right).
    By symmetry, the right internal point PRP_R will have an x-coordinate xR=12−xLx_R = 12 - x_L:

    xR=12−536=72−536 mmx_R = 12 - \frac{5\sqrt{3}}{6} = \frac{72 - 5\sqrt{3}}{6} \text{ mm}

    Numerically, xR≈10.557 mmx_R \approx 10.557 \text{ mm}.
    So, the right internal point is PR=(72−536,2.5)P_R = \left(\frac{72 - 5\sqrt{3}}{6}, 2.5\right).

  2. Draw the outer rectangle.

    Use the RECTANG command to draw the main outline.
    RECTANG
    Specify first corner point: 0,0
    Specify other corner point: 12,5

  3. Draw the internal lines.

    Use the LINE command to draw the four diagonal lines and the central horizontal line.

    • Draw the bottom-left diagonal: LINE Specify first point: 0,0 Specify next point: 1.443,2.5
    • Draw the bottom-right diagonal: LINE Specify first point: 12,0 Specify next point: 10.557,2.5
    • Draw the top-left diagonal: LINE Specify first point: 0,5 Specify next point: 1.443,2.5
    • Draw the top-right diagonal: LINE Specify first point: 12,5 Specify next point: 10.557,2.5
    • Draw the central horizontal line: LINE Specify first point: 1.443,2.5 Specify next point: 10.557,2.5

    Part 2: QBasic Program

    a) Write a QBasic program to enter names, Date of Birth, Place of Birth, State of Origin, Sex, Age.

    CLS ' Clears the screen
    
    ' Declare variables
    DIM Name AS STRING
    DIM DateOfBirth AS STRING
    DIM PlaceOfBirth AS STRING
    DIM StateOfOrigin AS STRING
    DIM Sex AS STRING
    DIM Age AS INTEGER
    
    ' Input data from the user
    INPUT "Enter Name: ", Name
    INPUT "Enter Date of Birth (DD/MM/YYYY): ", DateOfBirth
    INPUT "Enter Place of Birth: ", PlaceOfBirth
    INPUT "Enter State of Origin: ", StateOfOrigin
    INPUT "Enter Sex (M/F): ", Sex
    INPUT "Enter Age: ", Age
    
    ' Display the entered information (optional, but good practice)
    PRINT
    PRINT "--- Entered Information ---"
    PRINT "Name: "; Name
    PRINT "Date of Birth: "; DateOfBirth
    PRINT "Place of Birth: "; PlaceOfBirth
    PRINT "State of Origin: "; StateOfOrigin
    PRINT "Sex: "; Sex
    PRINT "Age: "; Age
    
    END ' Ends the program
    

    b) You are to print out the hard copy of your source code.
    This means you should print the QBasic program code (the text shown above) onto paper. In QBasic, you would typically save the program file and then use a print command from the QBasic editor or operating system to get a physical copy.

Was this helpful?

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question