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
iragen [17]
3 years ago
5

Each of the following programs has errors. Find as many as you can. 65. // Find the error in this program. #include using namesp

ace std; int main() { int num1 = 0, num2 = 10, result; num1++; result = ++(num1 + num2); cout << num1 << " " << num2 << " " << result; return 0; }
Computers and Technology
1 answer:
Serggg [28]3 years ago
7 0

Answer:

There are two error in this program--

  1. In header file inclusion, file is not defined.
  2. In the statement "result = ++(num1 + num2);" , bracket is fixed after the increment operator.

Explanation:

  • For the first error, the user needs to add the file because "#include" is used to add the library for the program which states about the function and symbols used in the program.
  • The second error is because there must be a variable with the increment operator ( increment operator is being used to increase the value of a variable by 1), but there is a small brace fix in between the operator and operands.
You might be interested in
Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use
jeyben [28]

Question:

Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the gas equation PV = nRT, where P is pressure in Pascals, V is volume in cubic meters, n is number of moles, R is the gas constant 8.3144621 ( J / (mol*K)), and T is temperature in Kelvin.

Answer:

This solution is implemented in C++

double compute_gas_volume(double P, double T, double n){

   double V = 8.3144621 * n * T/P;

   return V;

}

Explanation:

This line defines the function, along with three parameters

double compute_gas_volume(double P, double T, double n){

This calculates the volume

   double V = 8.3144621 * n * T/P;

This returns the calculated volume

   return V;

}

To call the function  from the main, use:

<em>cout<<compute_gas_volume(P,T,n);</em>

<em />

<em>Where P, T and n are double variables and they must have been initialized</em>

5 0
3 years ago
Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
Anarel [89]

Answer:

The code to this question can be given as:

Code:

int lastVector = newScores.size() -1; //define variable lastVector that holds updated size of newScores.

newScores = oldScores; //holds value.

for (i = 0; i < SCORES_SIZE - 1; i++) //define loop.

{  

newScores.at(i) = newScores.at(i+1); //holds value in newScores.

}

newScores.at(lastVector) = oldScores.at(0); //moving first element in last.

Explanation:

  • In the given C++ program there are two vector array is defined that are "oldScores and newScores". The oldScores array holds elements that are "10, 20, 30, 40".
  • In the above code, we remove the array element at first position and add it to the last position. To this process, an integer variable "lastVector" is defined.  
  • This variable holds the size of the newScores variable and uses and assigns all vector array elements from oldScores to newScores. In the loop, we use the at function the removes element form first position and add in the last position.
  • Then we use another for loop for print newScores array elements.  
4 0
3 years ago
A computer can read whatever you type into it.<br> A)True<br> B)False
motikmotik

Answer:

True

Explanation:

Everything typed into a computer is saved as data and logged.

3 0
3 years ago
Read 2 more answers
They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
VLD [36.1K]

Answer:

They predicted another cold day in Seattle and another windy day in Seattle.

4 0
3 years ago
Help i need 76 more points to rank up can some one nice get me those? please please please
lutik1710 [3]
????????????????????????
6 0
3 years ago
Read 2 more answers
Other questions:
  • How can a network design project benefit from the principles of itsm? How might itsm impede a network design project?
    11·1 answer
  • The acceleration of a body is 3 metre per second square what does it mean​
    11·2 answers
  • witch option in a presentation program contains the formatting and placeholders for all the items that appear on a slide?
    11·2 answers
  • "The _____ of the Open Systems Interconnection (OSI) model generates the receiver’s address and ensures the integrity of message
    6·2 answers
  • Select all that apply.
    13·1 answer
  • Given a String variable response that has already been declared, write some code that repeatedly reads a value from standard inp
    10·1 answer
  • Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matc
    14·1 answer
  • ______ is a customer-facing CRM application.<br><br> FAQ<br><br> Search<br><br> SFA<br><br> E-mail
    6·1 answer
  • How do you open an application on the macOS?
    11·2 answers
  • How exactly do you find the circumference by using C++ Programming? I really need a specific answer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!