Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.

Answers

Answer 1
Answer:

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   double side, height;

   

   cout<<"Enter the length of one of the sides of the base: ";

   cin>>side;

   cout<<"Enter the height: ";

   cin>>height;

   

   double area = side * side;

   double volume = area * height / 3;

   

   cout<<"The area of the base of the pyramid is: "<<area<<endl;

   cout<<"The height of the pyramid is: "<<height<<endl;

   cout<<"The volume of the pyramid is: "<<fixed<<setprecision(2)<<volume<<endl;

   return 0;

}

Pseudocode:

Declare side, height

Get side

Get height

Set area = side * side

Set volume = area * height / 3

Print area

Print height

Print volume

Explanation:

Include <iomanip> to have two decimal places

Declare the side and height

Ask the user to enter side and height

Calculate the base area, multiply side by side

Calculate the volume using the given formula

Print area, height and volume (use fixed and setprecision(2) to have two decimal places)


Related Questions

In almost all cases, touching power lines or coming into contact with energized sources will result in what? Select the best option. First degree burnsSevere injuries or death Neurological damage Amputations
Kara's teacher asked her to create a chart with horizontal bars. Which chart or graph should she use?Bar graphColumn chartLine graphPie chart
Technician A says a 2:1 gear ratio doubles the amount of torque. Technician B says a 2:1 gear ratio reduces the speed by half. Which technician is correct? A. Technician A onlyB. Neither Technician A nor Technician BC. Both Technician A and Technician BD. Technician B only
Add CSS rules to articles.css for the given news article webpage that matches the following styling: Both article's images styled with a width of 300px Article's tag styled with: 5px padding all around Font family of Arial Font size of 24px Font color of white Background color of red. Selecting the id of author-name-and-date, style the author name and date with: Font family of Arial Font size of 12px Font color of lightgray Article's text ( and tags) styled with: Font family of Times New Roman Font size of 16px Font color of gray Article's share links ( tags) styled with: Font family of Arial Font size of 12px Font color of blue Note: Colors, font sizes, padding, etc. must be exact.
. One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is to:A. report which device drivers a computer usesB. determine which ports are open on a computerC. report the status of individual computer usersD. determine which operating system is running on a computer

Assign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than once) and False otherwise.Here is the answer I wrote:


i = []
for i in range(len([s1])):
if s1.count(s1[i]) > 1:
has_dups = True
elif s1.count(s1[i]) = 1:
has_dups = False


Here is the message I got from the system:

Solutions with your approach don't usually use: elif



Please Help me to correct it.

Answers

i dont know the language of the code
probably you have sintacs mistakes in it

has_dups = false
for i in range(len([s1])):
has_dups = has_dups || s1.count(s1[i]) > 1

Subtract (100000)2 from (111)2 using 1s and 2s complement method of subtraction​

Answers

Answer:

-11001

Explanation:

The following steps are performed in order to perform subtraction of the given binary numbers:

Step 1:

Find 2’s complement of the subtrahend. The subtrahend here is 100000

100000

First take 1's complement of 100000

1's complement is taken by inverting 100000

1's complement of 100000 = 011111

Now takes 2's complement by adding 1 to the result of 1's complement:

011111 + 1 = 100000

2's complement of 100000 = 100000

Step 2:

Add the 2's complement of the subtrahend to the minuend.

The number of bits in the minuend is less than that of subtrahend. Make the number of bits in the minuend equal to that of subtrahend by placing 0s in before minuend. So the minuend 111 becomes:

000111

Now add the 2's complement of 100000 to 000111

   0 0 0 1  1  1

+   1 0 0 0 0 0

    1 0 0 1  1  1

The result of the addition is :

 1 0 0 1  1  1

Step 3:

Since there is no carry over the next step is to take 2's complement of the sum and place negative sign with the result as the result is negative.

sum =   1 0 0 1  1  1

2's complement of sum:

First take 1's complement of 1 0 0 1  1  1

1's complement is taken by inverting 1 0 0 1  1  1

1's complement of 1 0 0 1  1  1 = 0 1 1 0 0 0

Now takes 2's complement by adding 1 to the result of 1's complement:

0 1 1 0 0 0 + 1 = 0 1 1 0 0 1

Now place the minus sign with the result of 2's complement:

- 0 1 1 0 0 1

Hence the subtraction of two binary numbers (100000)₂ and (111)₂  is

(-011001)₂

This can also be written as:

(-11001)₂

You are tasked with writing a program to process sales of a certain commodity. Its price is volatile and changes throughout the day. The input will come from the keyboard and will be in the form of number of items and unit price:36 9.50which means there was a sale of 36 units at 9.50. Your program should read in the transactions (Enter at least 10 of them). Indicate the end of the list by entering -99 0. After the data is read, display number of transactions, total units sold, average units per order, largest transaction amount, smallest transaction amount, total revenue and average revenue per order.

Answers

Answer:

Here the code is  given as,

Explanation:

Code:

#include <math.h>

#include <cmath>  

#include <iostream>

using namespace std;

int main() {

int v_stop = 0,count = 0 ;

int x;

double y;

int t_count [100];

double p_item [100];

double Total_rev = 0.0;

double cost_trx[100];

double Largest_element , Smallest_element;

double unit_sold = 0.0;

for( int a = 1; a < 100 && v_stop != -99 ; a = a + 1 )

  {

     cout << "Transaction # " << a << " : " ;

     cin >> x >> y;

 

  t_count[a] = x;

  p_item [a] = y;

  cost_trx[a] = x*y;

 

  v_stop = x;

  count = count + 1;

 

  }

 

  for( int a = 1; a < count; a = a + 1 )

  {

   Total_rev = Total_rev + cost_trx[a];

   unit_sold = unit_sold + t_count[a];

  }

 

  Largest_element = cost_trx[1];

  for(int i = 2;i < count - 1; ++i)

   {

      // Change < to > if you want to find the smallest element

      if(Largest_element < cost_trx[i])

          Largest_element = cost_trx[i];

   }

Smallest_element = cost_trx[1];

  for(int i = 2;i < count - 1; ++i)

   {

      // Change < to > if you want to find the smallest element

      if(Smallest_element > cost_trx[i])

          Smallest_element = cost_trx[i];

   }

  cout << "TRANSACTION PROCESSING REPORT     " << endl;

  cout << "Transaction Processed :           " << count-1 << endl;

  cout << "Uints Sold:                       " << unit_sold << endl;

  cout << "Average Units per order:          " << unit_sold/(count - 1) << endl;

  cout << "Largest Transaction:              " << Largest_element << endl;

  cout << "Smallest Transaction:             " << Smallest_element << endl;

  cout << "Total Revenue:               $    " << Total_rev << endl;

  cout << "Average Revenue :            $    " << Total_rev/(count - 1) << endl;

   

  return 0;

 

}

Output:

Select the true statement(s) regarding a virtual circuit. a. both analog and digital networks take advantage of the virtual circuit concept
b. virtual circuits require the assignment of dedicated physical links during network connection
c. regarding the efficient use of physical links, virtual circuits are more efficient than analog circuits
d. both a and b are true statements"

Answers

Answer:

The correct option is D

Explanation:

Generally for a virtual circuit   both analog and digital networks take advantage of the virtual circuit concept

Generally virtual circuits require the assignment of dedicated physical links during network connection

 Generally regarding the efficient use of physical links,  virtual circuits are NOT more efficient than analog circuits

Explain how signal detection theory can be used to analyze web site reading and searching. Based on this analysis, provide three suggestions for your favorite search engine or web site that includes search.

Answers

Answer:

Human visual behavior often includes searching, scanning, and monitoring.

While it should be possible to moderate the performance of these tasks based on the dimensions used in the table, it is often useful to analyze these situations using Signal Detection Theory (SDT).              

 

Three suggestions for my favourite search engine that includes search are:

1.  ensure that search results are graded according to the following categories using different colours:  

  • Most accurate and relevant results;
  • Accurate and slightly relevant results
  • Fairly accurate and fairly relevant results

These can help the users identify more easily the results to spend more time on. This categorisation can be done using colours. This is because of the way the eye functions. Unlike a camera snapshot, for example, the eye does not capture everything in a scene equally, but selectively picks out salient objects and features from the current context, and focuses on them so they can be processed in more detail.

2.  Another suggestion is that attention needs to be paid to where people look most of the time. It is not out of place for people to instinctively avoid search results that have dollar signs or currency signs especially when they are not searching for a commercial item.  

3. Lastly in displaying results that have images, it best to use sharp images. The theory suggests with respect to contrast, clarity and brightness that sharper and more distinct objects appear to be nearer, and duller objects appear to be farther away. To elicit the interest of the reader, targeted results or information from search engines must make use of the factors of contrast, clarity and brightness.

Cheers!

   

In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller networks.

Answers

Write the answers so we can answer your question

Other Questions