1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lakkis [162]
3 years ago
6

C++ CODE

Computers and Technology
1 answer:
cestrela7 [59]3 years ago
7 0

Answer:

#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;

int main()

{

   const double PI = 3.14159;

   double height;

   double radius;

   

   cout << "Enter the height of the cylinder: ";

   cin >> height;

   cout << "Enter the radius of the base of the cylinder: ";

   cin >> radius;

   cout << endl;

   cout << "Volume of the cylinder = " << setprecision(4) << PI * pow(radius, 2.0) * height << endl;

   cout << "Surface area: " << setprecision(4) << 2 * PI * radius * height + 2 * PI * pow(radius, 2.0) << endl;

   cout << endl;

   return 0;

}

Explanation:

Code is rearranged so that;

- Variables are defined,

- <em>height</em> and <em>radius</em> of the cylinder is asked from the user,

- The <u>volume</u> and <u>surface area</u> of the cylinder are calculated and printed. (<u>setprecision(4)</u> is used to print two decimal values)

You might be interested in
What type of attacks take advantage of vulnerabilities in poorly coded web application software to introduce malicious program c
Yakvenalex [24]

Answer:

SQL Injection

Explanation:

Coding a web application that uses a database is requiring close attention, where the developer closes any loophole any attacker may later want to exploit when the application is deployed. SQL Injection is a type of attack where the attacker places malicious code in the query statements through the form. This is possible if the input is not properly sanitized and cleaned.

5 0
2 years ago
Mention one application of AI from the real world and describe the use of of this application what is the type of learning used
gayaneshka [121]

Answer:

The real world AI application is Google Duplex. It is able to receive orders for making reservations. Then it calls the shop or the place and deals with the person and talks to him very fluently and informs you about the reservation. Some other general types of AI application are Google Assistant, Siri , Amazon Alexa and so on. But google Duplex is lot more advanced than them.

4 0
2 years ago
Give a pseudo-code description of the O(n)-time algorithm for computing the power function p(x,n).Also draw the trace of computi
laila [671]

Answer:

p(x,n)

1. if(n==0)    [if power is 0]

2.    then result =1.

3.else

4. {    result=1.

5.      for i=1 to n.

6.          {  result = result * x. }  [each time we multiply x once]

7.       return result.

8.  }

Let's count p(3,3)

3\neq0, so come to else part.

i=1: result = result *3 = 3

i=2: result = result *3 = 9

i=2: result = result *3 = 27

Explanation:

here the for loop at step 4 takes O(n) time and other steps take constant time. So overall time complexity = O(n)

6 0
3 years ago
What is the problem with assigning a port number to more than one server application?
Ilya [14]
Only one daemon (server application) can bind to a port. The second one will fail.
3 0
3 years ago
Human systems integration (hsi), a supportability issue that every program should consider, addresses such factors as accessibil
Tju [1.3M]

I guess the word in the blank is Standardization.

Human systems integration (HSI), a supportability issue that every program should consider, addresses such factors as accessibility, visibility, testability, and Standardization.


6 0
2 years ago
Other questions:
  • A dropped packet is often referred to as a _____________.
    7·1 answer
  • ___ is the branch of computer science that explores techniques for incorporating aspects of intelligence into computer systems.
    5·1 answer
  • What is a major plastics engineering project that is going on right now in Arizona?
    9·1 answer
  • Given 3 floating-point numbers. Use a string formatting expression with conversion specifiers to output their average and their
    14·1 answer
  • Isaac is researching Abraham Lincoln’s life for a social studies report. He finds an encyclopedia that includes original letters
    5·2 answers
  • How can supply and demand for different careers affect job stability and income?
    6·1 answer
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Sample Run Enter a Number: 98 Sample Output
    7·1 answer
  • What is my favorite color?<br> Red<br>Orange<br>Yellow<br>Blue <br>Gold<br>Silver
    13·1 answer
  • What happens when two computers use the same IP address?
    15·1 answer
  • Create a text file content.txt and copy-paste following text (taken from Wikipedia) into it: A single-tasking system can only ru
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!