0% found this document useful (0 votes)
59 views4 pages

Create A Flowchart, Pseudo Code, and Source Code That Will Solve The Following Machine Problems

The document provides flowcharts, pseudocode, and source code to solve two machine problems: 1) Find the area of a right triangle using Heron's Formula. It takes inputs for the three sides, calculates the semi-perimeter and area, and outputs the area. 2) Find the perimeter of a square from its area. It takes the area input, calculates perimeter as 4 times the square root of the area, and outputs the perimeter.

Uploaded by

Joseph Gabrillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views4 pages

Create A Flowchart, Pseudo Code, and Source Code That Will Solve The Following Machine Problems

The document provides flowcharts, pseudocode, and source code to solve two machine problems: 1) Find the area of a right triangle using Heron's Formula. It takes inputs for the three sides, calculates the semi-perimeter and area, and outputs the area. 2) Find the perimeter of a square from its area. It takes the area input, calculates perimeter as 4 times the square root of the area, and outputs the perimeter.

Uploaded by

Joseph Gabrillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COURSE: ITE 001 PROGRAM: BSCS PERIOD: Prelims DATE: July 08, 2019

NAME: RIVADENERA, Marjorie Anne ASSESSMENT: Assignment 1st Semester


SECTION: CS11FA1 TOPIC: Flowcharts S.Y. 2019-2020

Create a flowchart, pseudo code, and source code that will solve the following machine
problems:

1. Find the area of a right triangle using the Heron’s Formula.


A. Flowchart

START

a = 0, b = 0, c = 0
area = 0, s = 0

INPUT
(a,b,c)

s = (a + b + c)/2
area = sqrt(s*(s-a)*(s-b)*(s-c))

OUTPUT
(area)
END

B. Pseudo Code
Start
Initialize a, b, c, s, area
Read a, b, c
Compute
s = (a + b + c)/2
area = sqrt(s*(s-a)*(s-b)*(s-c))
Write
area
End
C. Source Code
#include <iostream>
#inclue <cmath>
using namespace std;
main(){
float a, b, c, s, area;
cout << “Enter the first side of a triangle: ” ;
cin >> a ;
cout << “Enter the second side of a triangle: ” ;
cin >> b ;
cout << “Enter the third side of a triangle: ” ;
cin >> c ;
s = (a + b + c)/2 ;
area = sqrt(s*(s-a)*(s-b)*(s-c)) ;
cout << “The area of the triangle is ” << area << endl;
}

2. Find the perimeter of a square from its area.


A. Flowchart

START
perimeter
area

INPUT
(area)

perimeter = 4*sqrt(area)

OUTPUT
(perimeter)

END

B. Pseudocode
Start
Initialize perimeter, area
Read area
Compute
perimeter = 4*sqrt(area)
Write
perimeter
End
C. Source Code
#include <iostream>
#include <cmath>
using namespace std;
main(){
float area, perimeter ;
cout << “Enter the area of a square: ” ;
cin >> area ;
perimeter = 4*sqrt(area) ;
cout << “The perimeter of the square is ” << perimeter ;
}

You might also like