program calculates

Jun 17th, 2015
Studypool Tutor
Northern Arizona University
Price: $25 USD

Tutor description

This program calculates the price of milk, both regular and ultimate when the number of litters (a positive number) is entered by the user.

Word Count: 162
Showing Page: 1/4
SOLUTION:Program Design: Here is the design strategy of the program.At program startup, main module will be executed which will carry out the following steps:Declare variables.Get user input for length and width.Call calcArea module to calculate area of the rectangle.Call calcPerimeter module to calculate perimeter of the rectangle.Call dispResults module to display results to the user. Psuedocode:Module Main() Declare width, height, area, perimeter as float Display Enter rectangle height: Input height Display Enter rectangle width: Input width area = calcArea(width, height) perimeter = calcPerimeter( width, height) dispResults(area, perimeter)End MainModule calcArea(width, height) Return with width x heightEnd calcAreaModule calcPerimeter(width, height) Return with (2 x width + 2 x height)End calcPerimeterModule dispResults(area, perimeter) Display area Display perimeterEnd dispResults Hierarchy Chart: Flow Charts:Main module:calcArea Module:calcPerimeter Module:dispResults Module:1. Test DataS.NoInputExpected OutputActual OutputResultLengthWidthAreaPerimeterArea Perimeter

Review from student

Studypool Student
" Excellent work as always thanks so much "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1825 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors