Access over 20 million homework & study documents

Problem Analysis

Content type
User Generated
Type
Study Guide
Rating
Showing Page:
1/9
Running Head: FUNCTIONS & SUBGROUPS 1
http://getmeaplus.com/question.aspx?lang=en&uid=babayn&qde=q5643ba91be682922441
[Title of your Assignment]
Your name
Your Instructor’s name
Course #
Your Institution’s name
Date:

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/9
FUNCTIONS & SUBGROUPS 2
2
Functions and Subprogram
Write a program, using functions, that calculates the area and perimeter of a rectangle whose
dimensions (Length and width) are provided by a user.
1. Problem Analysis Following the directions in the assignment, clearly write up your
problem analysis in this section.
This program, using functions, will calculate the area and perimeter of a rectangle whose
dimensions are provided by a user. To calculate perimeter and area we need to know the two
sides of rectangle namely length and width of rectangle. Hence following two items are
required:
length of rectangle (Variable name - Rectangle_Length) of type Int
width of rectangle (Variable name - Rectangle_Width) of type Int
Outputs
We need to display the calculate perimeter and rectangle of the output as requested In the
assignment.
area of rectangle
perimeter of rectangle
Calculation
To calculate the area per output we need to use the formula of area=l*w
To calculate the perimeter per output we need to use the formula of perimeter = 2l+2w or
2(l+w)
Where l and w are length and width.
For example if l is 5 and w is 10
Perimeter = 2*5 + 2* 10 = 30
Area = 2 (5+10) = 30
2. Program Design Following the directions in the assignment, clearly write up your problem
design in this section and comment your pseudocode.
Input Module
Declare Rectangle_Length, Rectangle_Width as int
//we need input for length
Write "what is the length of rectangle in centimeters?"
Input Rectangle_LengthH

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/9

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 9 pages?
Access Now
Unformatted Attachment Preview
http://getmeaplus.com/question.aspx?lang=en&uid=babayn&qde=q5643ba91be682922441 [Title of your Assignment] Your name Your Instructor’s name Course # Your Institution’s name Date: Functions and Subprogram Write a program, using functions, that calculates the area and perimeter of a rectangle whose dimensions (Length and width) are provided by a user. 1. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. This program, using functions, will calculate the area and perimeter of a rectangle whose dimensions are provided by a user. To calculate perimeter and area we need to know the two sides of rectangle namely length and width of rectangle. Hence following two items are required: length of rectangle (Variable name - Rectangle_Length) of type Int width of rectangle (Variable name - Rectangle_Width) of type Int Outputs We need to display the calculate perimeter and rectangle of the output as requested In the assignment. area of rectangle perimeter of rectangle Calculation To calculate the area per output we need to use the formula of area=l*w To calculate the perimeter per output we need to use the formula of perimeter = 2l+2w or 2(l+w) Where l and w are length and width. For example if l is 5 and w is 10 Perimeter = 2*5 + 2* 10 = 30 Area = 2 (5+10) = 30 2. Program Design – Following the directions in the assignment, clearly write up your problem design in this sectio ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Excellent! Definitely coming back for more study materials.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Documents