We read your photo as:

Algorithm to find sum of given data values until a negative value is entered:

Computer Science

ScanSolve AI Answer

Step-by-step solution

7 steps

Here are the solutions to your assignments:

  1. Algorithm to find sum of given data values until a negative value is entered

    Algorithm: SumUntilNegative
    1.  Initialize SUM = 0
    2.  Start Loop:
    3.      Read NUMBER
    4.      If NUMBER < 0 Then
    5.          Exit Loop
    6.      Else
    7.          SUM = SUM + NUMBER
    8.      End If
    9.  End Loop
    10. Print SUM
    11. End
    
  2. Algorithm and Flowchart to compute the volume of a sphere

    • Algorithm:

      Algorithm: CalculateSphereVolume
      1.  Start
      2.  Define PI = 3.1416
      3.  Read RADIUS (r)
      4.  Calculate VOLUME (V) = (4/3) * PI * r^3
      5.  Display VOLUME (V)
      6.  End
      
    • Flowchart (text description):

      • Start (Terminal shape)
      • ↓\downarrow
      • Set PI = 3.1416 (Process shape)
      • ↓\downarrow
      • Input RADIUS (r) (Input/Output shape)
      • ↓\downarrow
      • Calculate VOLUME = (4/3) * PI * r^3 (Process shape)
      • ↓\downarrow
      • Output VOLUME (Input/Output shape)
      • ↓\downarrow
      • End (Terminal shape)
  3. Pseudocode for how to polish your shoes

    Pseudocode: PolishShoes
    1.  Start
    2.  Gather materials: shoes, shoe polish, brush, soft cloth.
    3.  Clean shoes: Use the soft cloth to wipe off any dirt or dust from the shoes.
    4.  Apply polish: Take a small amount of shoe polish with the brush and apply it evenly over the entire surface of the shoes.
    5.  Let dry: Allow the polish to dry for a few minutes.
    6.  Buff: Using a clean section of the soft cloth, rub the shoes vigorously until they achieve a desired shine.
    7.  End
    
  4. Algorithm to input three sides of a triangle and print if it is scalene, isosceles or equilateral

    Algorithm: ClassifyTriangle
    1.  Start
    2.  Read side A, side B, side C
    3.  If (A + B > C) AND (A + C > B) AND (B + C > A) Then
    4.      If (A = B) AND (B = C) Then
    5.          Print "Equilateral Triangle"
    6.      Else If (A = B) OR (B = C) OR (A = C) Then
    7.          Print "Isosceles Triangle"
    8.      Else
    9.          Print "Scalene Triangle"
    10.     End If
    11. Else
    12.     Print "Invalid Triangle (sides cannot form a triangle)"
    13. End If
    14. End
    
  5. Flowchart for buying stationery from the market (text description)

    • Start (Terminal shape)
    • ↓\downarrow
    • Make a list of needed stationery items (Process shape)
    • ↓\downarrow
    • Decision: Do I have enough money? (Diamond shape)
      • If No: →\rightarrow Go to ATM / Borrow money (Process shape) →\rightarrow Connects back to "Decision: Do I have enough money?"
      • If Yes: ↓\downarrow
    • Go to the stationery shop (Process shape)
    • ↓\downarrow
    • Find the required items (Process shape)
    • ↓\downarrow
    • Decision: Are all items available? (Diamond shape)
      • If No: →\rightarrow Go to another shop / Buy alternatives (Process shape) →\rightarrow Connects back to "Find the required items"
      • If Yes: ↓\downarrow
    • Go to the billing counter (Process shape)
    • ↓\downarrow
    • Pay for the items (Process shape)
    • ↓\downarrow
    • Collect the items and receipt (Process shape)
    • ↓\downarrow
    • Return home (Process shape)
    • ↓\downarrow
    • End (Terminal shape)
  6. Flowchart for the steps required to play music stored in a CD (text description)

    • Start (Terminal shape)
    • ↓\downarrow
    • Get a music CD (Process shape)
    • ↓\downarrow
    • Get a CD player (Process shape)
    • ↓\downarrow
    • Decision: Is the CD player plugged in and powered on? (Diamond shape)
      • If No: →\rightarrow Plug in CD player and turn on power (Process shape) →\rightarrow Connects back to "Decision: Is the CD player plugged in and powered on?"
      • If Yes: ↓\downarrow
    • Open the CD tray (Process shape)
    • ↓\downarrow
    • Place the CD into the tray (label side up) (Process shape)
    • ↓\downarrow
    • Close the CD tray (Process shape)
    • ↓\downarrow
    • Decision: Are speakers/headphones connected and turned on? (Diamond shape)
      • If No: →\rightarrow Connect speakers/headphones and turn on (Process shape) →\rightarrow Connects back to "Decision: Are speakers/headphones connected and turned on?"
      • If Yes: ↓\downarrow
    • Press the 'Play' button on the CD player (Process shape)
    • ↓\downarrow
    • Adjust volume (Process shape)
    • ↓\downarrow
    • End (Terminal shape)
  7. Flowchart to accept two numbers, if the first number is greater than the second number, print their sum, otherwise print their product (text description)

    • Start (Terminal shape)
    • ↓\downarrow
    • Input Num1 (Input/Output shape)
    • ↓\downarrow
    • Input Num2 (Input/Output shape)
    • ↓\downarrow
    • Decision: Is Num1 > Num2? (Diamond shape)
      • If Yes: →\rightarrow Calculate SUM = Num1 + Num2 (Process shape) →\rightarrow ↓\downarrow
      • If No: →\rightarrow Calculate PRODUCT = Num1 * Num2 (Process shape) →\rightarrow ↓\downarrow
    • Output Result (SUM or PRODUCT) (Input/Output shape - where the two paths merge)
    • ↓\downarrow
    • End (Terminal shape)
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