C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
bartleby

Videos

Question
Book Icon
Chapter 6.2, Problem 6E

(a)

Program Plan Intro

To definethe function surfarea(double r, double l) that returns the side surface area of cylinder by using the below formula: -

  S=2Πrlristheradiusandlisthelengthofcylinder

(b)

Program Plan Intro

Program plan:

  • Import the header file and use the namespacestd.
  • Declare the function surfarea(double r, double l).
  • Define the main function.
  • Declare the variables to store the radius and length.
  • Prompt the user to enter the radius and length of the cylinder.
  • Call the function surfarea() and displaying the value returned by it.
  • Define the function surfarea() that takes radius and length of the cylinder as the function arguments and returns the side surface area of the cylinder.
  • Declare the variable to store the side surface area of cylinder.
  • Calculate the side surface area.
  • Return the side surface area.

Program description:

The main purpose of the program is to implement the function written in Exercise 6a into the main function and test the function to get the appropriate output.

Blurred answer
Students have asked these similar questions
Find the error, assume data is a string and all variables have been declared. for ch in data:         if ch.isupper:             num_upper = num_upper + 1         if ch.islower:             num_lower = num_lower + 1         if ch.isdigit:             num_digits = num_digits + 1         if ch.isspace:             num_space = num_space + 1
Find the Error: date_string = input('Enter a date in the format mm/dd/yyyy: ') date_list = date_string.split('-') month_num = int(date_list[0]) day = date_list[1] year = date_list[2] month_name = month_list[month_num - 1] long_date = month_name + ' ' + day + ', ' + year print(long_date)
Find the Error:       full_name = input ('Enter your full name: ')       name = split(full_name)       for string in name:         print(string[0].upper(), sep='', end='')         print('.', sep=' ', end='')
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License