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)
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.
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)₂
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:
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"
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
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:
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!
Write the answers so we can answer your question