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
Nonamiya [84]
3 years ago
7

Suppose that you have the following declaration:

Computers and Technology
1 answer:
masha68 [24]3 years ago
6 0

Answer:

Explanation:

The code is written in C++:

#include <iostream>

#include <stack>

#include <math.h>

#include <iomanip>

using namespace std;

/*

* Supporting method to print contents of a stack.

*/

void print(stack<double> &s)

{

if(s.empty())

{

cout << endl;

return;

}

double x= s.top();

s.pop();

print(s);

s.push(x);

cout << x << " ";

}

int main(){

// Declaration of the stack variable

stack<double> stack;

//rray with input values

double inputs[] = {25,64,-3,6.25,36,-4.5,86,14,-12,9};

/*

* For each element in the input, if it is positive push the square root into stack

* otherwise push the square into the stack

*/

for(int i=0;i<10;i++){

if(inputs[i]>=0){

stack.push(sqrt(inputs[i]));

}else{

stack.push(pow(inputs[i],2));

}

}

//Print thye content of the stack

print(stack);

}

OUTPUT:

5     8     9     2.5     6     20.25     9.27362     3.74166     144     3

-------------------------------------------------------------------------

Process exited after 0.01643 seconds with return value 0

Press any key to continue . . . -

You might be interested in
Review universal data models and discuss how these are being used more widely today. Does a data modeling project using a packag
adell [148]

Answer:

2. A data modelling project using a packaged data model REQUIRES A GREATER SKILL than a project not using a packaged data model.

Explanation:

1a. Review of universal models:

A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real world entities. It has become the standard approach used towards designing databases.

A universal data model is a template data model that can be reused as a starting point or a building block to jump-start development of a data modelling project, industry specific model, logical data models.

1b. Discuss how these are being used more widely today.

*Universal data models helps professional reduce development time, improve consistency and standardization while achieving high quality models.

*Higher quality: just as architects consider blue prints before constructing a building, one should also consider data before building an app. A data model helps define the problem, enabling one to consider different approaches and choose best ones.

*By properly modelling and organization's data, the database designer can eliminate data redundancies (needless repetitions) which are a key source for inaccurate information and ineffective systems.

2. Greater and advanced skills are adequate and required when data modelling project is done using packaged data model while fewer skills are required when data modelling is done without packaged data model.

7 0
2 years ago
Read 2 more answers
when I was playing Mobile legends bang bang online Match The game logged Me out and when I was Trying To reconnect it failed and
Helen [10]

Answer:

it's most prolly a bug.The game crashes a lot tbh

5 0
3 years ago
A technician needs to be prepared to launch programs even when utility windows or the Windows desktop cannot load. What is the p
lisov135 [29]

Answer:

Windows includes a tool called Microsoft System Information (Msinfo32.exe). This tool gathers information about your computer and displays a comprehensive view of your hardware, system components, and software environment, which you can use to diagnose computer issues.

Explanation:

7 0
3 years ago
Conceptos importantes de red de computadoras
Bumek [7]

Answer:

-Consiste en conectar varias redes de computadoras basadas en diferentes protocolos -Requiere la definición de un protocolo de interconexión común sobre los protocolos locales. -El Protocolo de Internet (IP) desempeña este papel, definiendo direcciones únicas para una red y una máquina host.

3 0
3 years ago
If you hold down the alt key and click anywhere in your document what happens
sukhopar [10]
<span>The Alt key on a PC is utilised to change the capacity of other squeezed keys. It will go to any desired short cut in the computer that is being accessed. in short , one can use this to reach other functionality of a windows based computer easily. For example, if you were accessing documents and you want to skip to a different function from what you were doing on the desktop.</span>
4 0
3 years ago
Other questions:
  • Your dad just purchased a new desktop with Windows 8 Professional. He is calling you, informing you that he is unable to remote
    9·1 answer
  • Jacob is a teacher and wants to sort his grades based on Test 1 and then on Test 2.
    14·2 answers
  • What is ucspi-tcp pakage in qmail??
    5·1 answer
  • I need help ASAP Please! :)
    5·1 answer
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • Do you guys know if there's a way for me to find a Google doc that I typed but forgot to save if you do it for points i will rep
    10·2 answers
  • (9/5)C+32 write QBASIC expessions for this​
    7·1 answer
  • Dante needs to query a table to find all the references to a particular product and apply a 10%
    7·2 answers
  • Do you want my hero academia?<br><br><br><br><br><br> if so, who's your favorite character :&gt;
    5·2 answers
  • Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and ins
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!