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
kolezko [41]
3 years ago
11

Each cout statement has a syntax error. Type the first cout statement, and press Run to observe the error message. Fix the error

, and run again. Repeat for the second, then third, cout statement. cout << "Num: " << songnum << endl; cout << int songNum << endl; cout << songNum " songs" << endl; Note: These activities may test code with different test values. This activity will perform two tests: the first with songNum = 5, the second with songNum = 9. See How to Use zyBooks.
Engineering
1 answer:
saul85 [17]3 years ago
4 0

Answer:

1. cout << "Num: " << songNum << endl;

2. cout << songNum << endl;

3. cout << songNum <<" songs" << endl;

Explanation:

//Full Code

#include <iostream>

using namespace std;

int main ()

{

int songNum;

songNum = 5;

cout << "Num: " << songNum << endl;

cout << songNum << endl;

cout << songNum <<" songs" << endl;

return 0;

}

1. The error in the first cout statement is that variable songnum is not declared.

C++ is a case sensitive programme language; it treats upper case and lower case characters differently.

Variable songNum was declared; not songnum.

2. Cout us used to print a Variable that has already been declared.

The error arises in int songNum in the second cout statement.

3. When printing more than one variables or values, they must be separated with <<

You might be interested in
Explain about Absolute viscosity, kinematic viscosity and SUS?
ArbitrLikvidat [17]

Answer:

Absolute viscosity is the evaluation of the resistance (INTERNAL) of the fluid  flow

Kinematic viscosity relates to the dynamic viscosity and density proportion.

SUS stands for Sabolt Universal Seconds. it is units which described the variation of oil viscosity

Explanation:

Absolute viscosity is the evaluation of the resistance (INTERNAL) of the fluid  flow, whereas Kinematic viscosity relates to the dynamic viscosity and density proportion. fluid with distinct kinematic viscosities may have similar dynamic viscosities and vice versa.Dynamic viscosity provides you details of  power required to make the fluid flow at some rate, however kinematic viscosity shows how quick the fluid moves when applying a certain force.

SUS stands for Sabolt Universal Seconds. it is units which described the variation of oil viscosity when change with change in temperature. it is measured by using viscosimeter.

3 0
3 years ago
The following is a list of metals and alloys:
viktelen [127]

Answer:

A) Gray cast iron

B) Aluminum

C) Titanium alloy

D) Tool steel

E) Titanium alloy

F) magnesium

G) Tungsten

5 0
3 years ago
Unit for trigonometric functions is always "radian". 1. 10 points: Do NOT submit your MATLAB code for this problem (a) Given f(x
RoseWind [281]

Answer:

Below is the required code.

Explanation:

%% Newton Raphson Method

clear all;

clc;

x0=input('Initial guess:\n');

x=x0;

f=exp(-x)-sin(x)-0.2;

g=-exp(-x)-cos(x);

ep=10;

i=0;

cc=input('Condition of convergence:\n');

while ep>=cc

i=i+1;

temp=x;

x=x-(f/g);

f=exp(-x)-sin(x)-0.2;

g=-exp(-x)-cos(x);

ep=abs(x-temp);

fprintf('x = %6f and error = %6f at iteration = %2f \n',x,ep,i);

end

fprintf('The solution x = %6f \n',x);

%% End of MATLAB Program

Command Window:

(a) First Root:

Initial guess:

1.5

Condition of convergence:

0.01

x = -1.815662 and error = 3.315662 at iteration = 1.000000

x = -0.644115 and error = 1.171547 at iteration = 2.000000

x = 0.208270 and error = 0.852385 at iteration = 3.000000

x = 0.434602 and error = 0.226332 at iteration = 4.000000

x = 0.451631 and error = 0.017029 at iteration = 5.000000

x = 0.451732 and error = 0.000101 at iteration = 6.000000

The solution x = 0.451732

>>

Second Root:

Initial guess:

3.5

Condition of convergence:

0.01

x = 3.300299 and error = 0.199701 at iteration = 1.000000

x = 3.305650 and error = 0.005351 at iteration = 2.000000

The solution x = 3.305650

>>

(b) Guess x=0.5:

Initial guess:

0.5

Condition of convergence:

0.01

x = 0.450883 and error = 0.049117 at iteration = 1.000000

x = 0.451732 and error = 0.000849 at iteration = 2.000000

The solution x = 0.451732

>>

Guess x=1.75:

Initial guess:

1.75

Condition of convergence:

0.01

x = 227.641471 and error = 225.891471 at iteration = 1.000000

x = 218.000998 and error = 9.640473 at iteration = 2.000000

x = 215.771507 and error = 2.229491 at iteration = 3.000000

x = 217.692636 and error = 1.921130 at iteration = 4.000000

x = 216.703197 and error = 0.989439 at iteration = 5.000000

x = 216.970438 and error = 0.267241 at iteration = 6.000000

x = 216.971251 and error = 0.000813 at iteration = 7.000000

The solution x = 216.971251

>>

Guess x=3.0:

Initial guess:

3

Condition of convergence:

0.01

x = 3.309861 and error = 0.309861 at iteration = 1.000000

x = 3.305651 and error = 0.004210 at iteration = 2.000000

The solution x = 3.305651

>>

Guess x=4.7:

Initial guess:

4.7

Condition of convergence:

0.01

x = -1.916100 and error = 1.051861 at iteration = 240.000000

x = -0.748896 and error = 1.167204 at iteration = 241.000000

x = 0.162730 and error = 0.911626 at iteration = 242.000000

x = 0.428332 and error = 0.265602 at iteration = 243.000000

x = 0.451545 and error = 0.023212 at iteration = 244.000000

x = 0.451732 and error = 0.000187 at iteration = 245.000000

The solution x = 0.451732

>>

Explanation:

The two solutions are x =0.451732 and 3.305651 within the range 0 < x< 5.

The initial guess x = 1.75 fails to determine the solution as it's not in the range. So the solution turns to unstable with initial guess x = 1.75.

7 0
3 years ago
The 30-kg gear is subjected to a force of P=(20t)N where t is in seconds. Determine the angular velocity of the gear at t=4s sta
tatyana61 [14]

Answer:

\omega =\frac{24}{1.14375}=20.983\frac{rad}{s}

Explanation:

Previous concepts

Angular momentum. If we consider a particle of mass m, with velocity v, moving under the influence of a force F. The angular  momentum about point O is defined as the “moment” of the particle’s linear momentum, L, about O. And the correct formula is:

H_o =r x mv=rxL

Applying Newton’s second law to the right hand side of the above equation, we have that r ×ma = r ×F =

MO, where MO is the moment of the force F about point O. The equation expressing the rate of change  of angular momentum is this one:

MO = H˙ O

Principle of Angular Impulse and Momentum

The equation MO = H˙ O gives us the instantaneous relation between the moment and the time rate of change of angular  momentum. Imagine now that the force considered acts on a particle between time t1 and time t2. The equation MO = H˙ O can then be integrated in time to obtain this:

\int_{t_1}^{t_2}M_O dt = \int_{t_1}^{t_2}H_O dt=H_0t2 -H_0t1

Solution to the problem

For this case we can use the principle of angular impulse and momentum that states "The mass moment of inertia of a gear about its mass center is I_o =mK^2_o =30kg(0.125m)^2 =0.46875 kgm^2".

If we analyze the staritning point we see that the initial velocity can be founded like this:

v_o =\omega r_{OIC}=\omega (0.15m)

And if we look the figure attached we can use the point A as a reference to calculate the angular impulse and momentum equation, like this:

H_Ai +\sum \int_{t_i}^{t_f} M_A dt =H_Af

0+\sum \int_{0}^{4} 20t (0.15m) dt =0.46875 \omega + 30kg[\omega(0.15m)](0.15m)

And if we integrate the left part and we simplify the right part we have

1.5(4^2)-1.5(0^2) = 0.46875\omega +0.675\omega=1.14375\omega

And if we solve for \omega we got:

\omega =\frac{24}{1.14375}=20.983\frac{rad}{s}

8 0
3 years ago
Joe Bruin has a big lawn in front of his house that is 30 meters wide and 20 meters long. Josephine makes him go out and mow the
zysi [14]

<u>Explanation:</u>

5 Horsepower for 30 mins,

(5)(745.7) = 3.7285 KW power delivered

General Efficiency of IC engine = 20%

Power required = \frac{3 \cdot 7285}{0 \cdot 2}=18 \cdot 6425 kw

Energy required per week,

=P × Time = 18.64 × 60 × 30 = 33.5565 MJ

Lawn area = (30) (20) = 600m^{2}

let sunlight hours be 8 hours

Hence, solar power input on lawn,

=5.62×3600 = 20232 kJ/m^{2}/day

energy input in lawn = (600) (20232) (7)

                                  = 84974.4 mJ/week

Chemical efficiency by photosynthesis = 4%

Chemical content in grass = (84974.4) (0.04)

                                            = 3398.97 mJ

Mass of the clippers  \(=(30)(20)(1 \cdot 096)^{2}(667)\)

                                  \(=478632 \cdot 33\) pounds

Removing water content,

dried grass clippings \(=95726.46\) pound

                                    = 11533.25 gallons

Trash cans repaired  

                                     =\frac{11533}{50} =230.66\\=231 cans

By burning the gas, total energy input = 3398.97 MJ × 0.2

                                                                = 679.794 MJ

Efficiency of steeling engine  =  20%

Energy output by engine = 679.794 ×0.2

                                          = 135.96 mJ

Energy required by mover = 33.5565 mJ

Hence, Energy (output) ⇒ energy required

5 0
3 years ago
Other questions:
  • Valves on steam lines are commonly encountered and you should know how they work. For most valves, the change in velocity of the
    10·1 answer
  • A flat-plate solar collector is used to heat water by having water flow through tubes attached at the back of the thin solar abs
    8·1 answer
  • A digital Filter is defined by the following difference equation:
    11·1 answer
  • The following passage contains a fragment. Select the correct revision. Presley took the exuberance of gospel and added the freq
    7·1 answer
  • How can you drop two eggs the feweHow can you drop two eggs the fewest amount of times, without them breaking? ...st amount of t
    13·2 answers
  • Which cod is the best whoever has the best awnser gets brainliest​
    12·1 answer
  • Select the correct answer. The most frequent maintenance task for a car is: A. Oil changes B. Tire replacements C. Coolant chang
    10·2 answers
  • At a retirement party, a coworker described terry as dedicated
    9·1 answer
  • A cross beam in a highway bridge experiences a stress of 14 ksi due to the dead weight of the bridge structure. When a fully loa
    14·1 answer
  • Not all projects that engineers work on will have human factors involved.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!