Perimeter = 2*(length+width)

Slides:



Advertisements
Similar presentations
Working with Shapes in Two Dimensions
Advertisements

Exercise 2.
A program example is given below to input date and display on the screen by write a class ‘ date ‘ # include Class date { Private: Int y, m, d ; Publice.
1 Objectives Understand streamed input and output.
CS Sept Your first C++ program… Boilerplate // Cannon, demo program #include using namespace std; int main() {// program goes here… return.
Chapter 4 Summation.
Exercise 5.
Perimeter Rectangles, Squares, and Triangles Perimeter Measures the distance around the edge of any flat object. To find the perimeter of any figure,
Geometry.
Programming is instructing a computer to perform a task for you with the help of a programming language.
By: Nicholas Currie, Patrick Ludemann and Nicholas Woo.
Area and Perimeter.
$100 Area of Parallelograms Area of Triangles Perimeter And Area Area of Trapezoids Area of Compound Figures & Area and Circumference of Circles $200.
© 2008 Pearson Addison-Wesley. All rights reserved Chapter 1 Section 9-3 Perimeter, Area, and Circumference.
Section 9-4 Perimeter, Area, and Circumference.
Programming in C++ Lecture Notes 6 Void Functions (Procedures) Andreas Savva.
Rectangle The area of a rectangle is by multiplying length and height. The perimeter of a rectangle is the distance around the outside of the rectangle.
= (2 in) · (2 in) = 4 in 2. P = a + b + c A = ½(8*8) A = 32 P = =20.
Perimeter & Area Lessons 19 & 20.
1 2/6/1435 h Wednesday Lecture 8. 2 Q: What is a %(modulus) operator ? 1. % (modulus) operator computes the remainder resulting from integer division.
5 CM 4 CM Calculation Area = Length times Width (lw or l x W) Note Length of a rectangle is always the longest side.
Chapter 2 Sections 5-6 Problem Solving and Formulas.
Objective Apply formulas for perimeter, area, and circumference.
Objective Apply formulas for perimeter, area, and circumference.
Areas and Perimeter of Rectangles, Square, Triangles and Circles
The circumference of the circle is 50  feet. The area of the shaded region = ________ example 1 :
How to start Visual Studio 2008 or 2010 (command-line program)
Current Assignments Homework 3 is due tonight. Iteration and basic functions. Exam 1 on Monday.
Math Education Educational Technology EDU 529 Jun 30, 2003 David Bloom.
Value and Reference Parameters. CSCE 1062 Outline  Summary of value parameters  Summary of reference parameters  Argument/Parameter list correspondence.
1.8: Perimeter, Circumference, and Area
Perimeter & Circumference Return to table of contents.
USING FORMULAS IN GEOMETRY Geometry H2 (Holt 1-5)K. Santos.
Area & Perimeter. SHAPE OVERVIEW Rectangle Triangle Hexagon Trapezoid Square Parallelogram Pentagon Circle.
1 Original Source : and Problem and Problem Solving.ppt.
C++ Programming, Namiq Sultan1 Chapter 3 Expressions and Interactivity Namiq Sultan University of Duhok Department of Electrical and Computer Engineerin.
Lecture 4 Function example. Example1 int max (int a, int b) { int c; if (a > b) c = a; else c = b; return (c); } void main ( ) {int x, y; cin>>x>>y; cout.
The length of a rectangle is 6 in. more than its width. The perimeter of the rectangle is 24 in. What is the length of the rectangle? What we know: Length.
© T Madas. Find the mean percentage mark of 37%, 42%, 68%, 55% and 39%. Find of Find 7% of 675. Find the area of a triangle with base of 1.25.
Lesson 1-7: Perimeter,Circumference & Area Warmup A has coordinates (3, 8). B has coordinates (0, –4). C has coordinates (–5, –6). 1. Find the distance.
To find the perimeter of a rectangle, just add up all the lengths of the sides: Perimeter = L + w + L + w         = 2L + 2w To find the area of a rectangle,
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 8.2 Perimeter.
The length of a rectangle is twice the width. The perimeter is 72 inches. Find the length and the width of the rectangle.
Lecture 5: Expressions and Interactivity Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Lecture 5 Computer programming -1-. Input \ Output statement 1- Input (cin) : Use to input data from keyboard. Example : cin >> age; 2- Output (cout):
Area & Perimeter An Introduction. AREA The amount of space inside a 2-dimensional object. Measured in square units cm 2, m 2, mm 2 Example: 1 cm 2 cm.
Toddrick’s Shape Scrapbook By:Toddrick Newton. The perimeter, P, of a rectangle is given by the formula P = 2(l + w) where l is the length width of the.
Perimeter, Circumference and Area. Perimeter and Circumference Perimeter : The distance around a geometric figure. Circumference: The distance around.
LESSON 2 Basic of C++.
Area & Perimeter. Page ________ of Notebook Title: Area and Perimeter Title: Area and Perimeter Objective: Find Area and Perimeter Objective: Find Area.
Perimeter and Area Formulas.  Perimeter is the distance around an object. It is easily the simplest formula. Simply add up all the sides of the shape,
Intro. to Computer Programming Eng. Nehal A. Mohamed Spring Semester-2016.
G-11 (1-5) Using formulas in Geometry I can use formulas to compute perimeter and area of triangles, squares, rectangles, and circles.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
Lesson 91 Warm Up Pg. 474.
Perimeter, Area, and Circumference
UNIT 8: 2-D MEASUREMENTS PERIMETER AREA SQUARE RECTANGLE PARALLELOGRAM
1.5: Using Formulas in Geometry
Starting Out with C++: From Control Structures through Objects
Find the degree of each monomial. –4t5 22a4b7 –8mn2 10a2b3
1-5 Geometric Formulas Polygons
Happy Friday!!! Please take out some paper to take notes on today lesson. Be ready to begin class when the bell rings.
Introduction to Algorithms and Programming
Area & Perimeter.
By- Sabrina,Julianna, and Killian
Introduction to Algorithms and Programming
Introduction to Algorithms and Programming COMP151
Introduction to Algorithms and Programming COMP151
Presentation transcript:

Perimeter = 2*(length+width) Write C++ program to calculate the area and perimeter of ​​a rectangle. Note that the area of ​​the rectangle = length × width. Perimeter = 2*(length+width) #include <iostream> using namespace std; Int main() { int length, width; cout<<"length = "; cin>>length; cout<<"width = "; cin>>width; cout<<"perimeter = "<<2*(length+width)<<"\n"; cout<<"area = "<<length*width; return 0; }

Write C++ Program to calculate and print the area of a right-angled triangle . The base of the triangle = a The height of triangle= b Equation of area= (1/2)*a*b #include<iostream> using namespace std; int main() { int a,b; cout<<“Please enter the base of triangle \n”; cin>>a; cout<<“Please enter the height of triangle \n”; cin>>b; cout<<“Area of triangle= “<<(0.5)*a*b<<endl; return 0; }

Write c++ program that print the following form: \ Hello " C ' pp '   #include <iostream> using namespace std; void main() { cout<<" \\ Hello \" C \' pp \' "; }

Write a program to print your name in the first line in the left side, and the address in the middle of the third line, and nationality in the right side in the same line. #include <iostream> using namespace std; void main() { cout<<“Sara Mohamed \n\n\t\t\t"; cout<<“Al Kharj \t\t\t Saudi"; }

Write c++ program to accept integer number from user and then calculate the area of ​​a circle. Note: The equation of area circle = π * R2, where π is a constant value of approximately 3.14. perimeter = 2 * PI * R #include <iostream> Using namespace std; Int main() { float r, PI; PI = 3.1415926; cout<<“ Please enter radius of circle \n”; cin>>r; cout<<"area = "<< PI * r * r<<"\n"; cout<<" perimeter = "<< 2 * PI * r; return 0; }

Write a Program that does the following:- Promotes the user to enter 5 numbers. Print the Numbers. Print the sum and average of these five numbers. #include<iostream> using namespace std; int main() { int a,b,c,d,e,sum; float avg; cout<<"Enter the five numbers: \n"; cin>>a>>b>>c>>d>>e; sum = a + b + c + d + e; avg = sum/5; cout<<"the sum is "<<sum; cout<<" and the average is "<<avg<<endl; return 0; }  

Write c++ program to find the Perimeter and area of the square. The perimeter and area of the square are given by the following formula. Perimeter = sideLength* 4 Area = sideLength * sideLength Input Square sideLength Processing Area= sideLength * sideLength Perimeter= sideLength*4 Output Print Out the perimeter and area #include <iostream> using namespace std; int main() { int length, width; cout<<“Please enter length of square \n”; cin>>length; cin>>width; cout<<“Area= “<<length*length<<endl; cout<<“Perimeter= “<<4*length<<endl; return 0; }

Write the output of (x) X = 3 * ( 8 - 6 ) + 4 *4 X = 3*2+4*4 X = 6+4*4 X = 6+16 X = 22

Write the output (x) X = 8 – 3 * 2 + 4 / 2 ^ 2 X = 8 – 3 * 2 + 4 / 4 X = 8 – 6 + 4 / 4 X = 8 – 6 + 1 X = 2 + 1 X = 3

Write the output (x) X = ( 6 - 1 ) * 2 – 7 + 4 X = 5 * 2 – 7 + 4 X = 10 – 7 + 4 X = 3 + 4 X = 7

Write the output (x) X = 5 + 2 * 4 / 2 X = 5 + 8 / 2 X = 5 + 4 X = 9

Write the output (x) X = ( 3 + 2 ) * 2 * 2 X = 5 * 2 * 2 X = 10 * 2 X = 20

What is the result of each compare A = 1 , B = 5 Result of compare example A = B B = A + 4 A < > 1 A < B A < 0 A < = 3 B < = 3 A > B A > 0 B > = 5 B > = 6 false true

What is the result of each compare A = 1 , B = 2 , C = 3 Compare result example A + 4 = B + C A + B < C – 1 A + 3 < > B * C - 1 ( B + 3 ) * 2 > C * A - 1 true false