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
The fraction 460/7 is closest to which of the following whole numbers?
Bess [88]
I don’t see any of “the following numbers”
3 0
3 years ago
Identify the following as True or False.
Leni [432]

Answer:

The answer to this question as follows:

1) False

2) False

3) True

Explanation:

The description of the above option as follows

  • In option 1, A single character variable must be contained in one quote mark, but it is based on the alphabet, which is a specific device, and the price of a continued character varies from one device to another, that's why it is false.
  • In option 2, This option is wrong because in assembly language the identifier value must not exceed the length than 247 characters.
  • In option 3, It is correct because in the variable declaration the first char should be a letter, _, @ or $letter. A total of 1-247 characters. The default case is insensitive.

5 0
3 years ago
A cache has been designed such that it has 512 lines, with each line or block containing 8 words. Identify the line number, tag,
Reptile [31]

Answer:

Given address = 94EA6_{16}

tag = 0 * 94  ( 10010100 )

line = 0 * 1 D 4 ( 111010100 )

word position = 0*6 ( 110 )

Explanation:

using the direct mapping method

Number of lines = 512

block size = 8 words

word offset = log ^{8} _{2}  = 3 bit

index bit = log^{512}_{2}  = 9 bit

Tag = 20 - ( index bit + word offset ) = 20 - ( 3+9) = 8 bit

Given address = 94EA6_{16}

tag = 0 * 94  ( 10010100 )

line = 0 * 1 D 4 ( 111010100 )

word position = 0*6 ( 110 )

8 0
3 years ago
Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of
xxTIMURxx [149]

Answer:

theSentence = input('Enter sentence: ')

theSentence = theSentence.split()

sentence_split_list =[]

for word in theSentence:

  sentence_split_list.append(word[1:]+word[0]+'ay')

sentence_split_list = ' '.join(sentence_split_list)

print(sentence_split_list)

Explanation:

Using the input function in python Programming language, the user is prompted to enter a sentence. The sentence is splited and and a new list is created with this statements;

theSentence = theSentence.split()

sentence_split_list =[ ]

In this way every word in the sentence becomes an element in this list and individual operations can be carried out on them

Using the append method and list slicing in the for loop, every word in the sentence is converted to a PIG LATIN

The attached screenshot shows the code and output.

5 0
3 years ago
Suppose you use Batch Gradient Descent to train a neural network and you plot the training error at every epoch. If you notice t
Phantasy [73]

Answer:

The answer is "using validation error".

Explanation:

The validation error is used to response the test for one of the queries is activated to the participant, which may not properly answer the question. These errors go up continuously after each time, the processing rate is too high and also the method is different.  

  • These errors are also unless to increase when they are actually in the problem.  
  • The training level will be that, if the learning error may not increase when the model overrides the learning set and you should stop practicing.
6 0
3 years ago
Other questions:
  • Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with a
    13·1 answer
  • Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
    7·1 answer
  • Gap junctions and plasmodesmata have what feature in common?
    6·1 answer
  • For off campus work study positions, students should contact the
    6·1 answer
  • How to write greater than or equal to in excel if function
    7·1 answer
  • (fill in the blank) <br><br> ____ is when data is formatted, transmitted and received in a network.
    13·1 answer
  • A _________ is a component commonly used in an analog pressure gauge. Use letter keys to select choices A microprocessor B press
    8·1 answer
  • give the difference between functional and functional tools in the middle of to the circle give importance​
    10·1 answer
  • Edhesive in JAVA Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter
    13·1 answer
  • Help plz!! I will mark brainliest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!