CMIS102 Homework concession 4 (Worth 16% of your grade) Student reboot: William Moss Class/Section: CMIS Professor Name: Countryman Assignment referable date: 16 JUL 12 Problem rendering: Write a program, using functions, that calculates the subject area and circle of a rectangle whose dimensions (Length and breadth) are provided by a user. A. Problem abstract - Main staff: This faculty impart be the master(prenominal) starting faculty. It is responsible to shrink user foreplay and refer other modules to calculate and expose rectangle area and margin. - calc discipline module: This module will put one across rectangle withdrawnness and width as gossip and return rectangle area as output. realm will be calculated as: Area = length x width - calc border module: This module will take rectangle length and width as excitant and return rectangle perimeter as output. The parameter will be calculated as: Perimeter = 2 x width + 2 x length - give awayResults module: This module will take Area and Perimeter of the triangle as input arguments and display results to the user. B. Program institution At program startup, principal(prenominal) module will be executed which will pass out the following travel: o Declare variables. o Get user input for length and width. o claver calcArea module to calculate area of the rectangle.
o Call calcPerimeter module to calculate perimeter of the rectangle. o Call dispResults module to display resu! lts to the user. Psuedocode: mental faculty Main() Declare width, height, area, perimeter as muff march Enter rectangle height: Input height unwrap Enter rectangle width: Input width area = calcArea(width, height) perimeter = calcPerimeter( width, height) dispResults(area, perimeter) completion Main Module calcArea(width, height) Return with width x height End calcArea Module calcPerimeter(width, height)...If you want to get a full essay, order it on our website: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment