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
Fix the code so the program will run correctly for MAXCHEESE values of 0 to 20 (inclusive). Note that the value of MAXCHEESE is
GarryVolchara [31]

Answer:

Code fixed below using Java

Explanation:

<u>Error.java </u>

import java.util.Random;

public class Error {

   public static void main(String[] args) {

       final int MAXCHEESE = 10;

       String[] names = new String[MAXCHEESE];

       double[] prices = new double[MAXCHEESE];

       double[] amounts = new double[MAXCHEESE];

       // Three Special Cheeses

       names[0] = "Humboldt Fog";

       prices[0] = 25.00;

       names[1] = "Red Hawk";

       prices[1] = 40.50;

       names[2] = "Teleme";

       prices[2] = 17.25;

       System.out.println("We sell " + MAXCHEESE + " kind of Cheese:");

       System.out.println(names[0] + ": $" + prices[0] + " per pound");

       System.out.println(names[1] + ": $" + prices[1] + " per pound");

       System.out.println(names[2] + ": $" + prices[2] + " per pound");

       Random ranGen = new Random(100);

       // error at initialising i

       // i should be from 0 to MAXCHEESE value

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

           names[i] = "Cheese Type " + (char) ('A' + i);

           prices[i] = ranGen.nextInt(1000) / 100.0;

           amounts[i] = 0;

           System.out.println(names[i] + ": $" + prices[i] + " per pound");

       }        

   }

}

7 0
4 years ago
Water is boiled in a pot covered with a loosely fitting lid at a location where the pressure is 85.4 kPa. A 2.61 kW resistance h
eimsori [14]

Answer:

t = 6179.1 s = 102.9 min = 1.7 h

Explanation:

The energy provided by the resistance heater must be equal to the energy required to boil the water:

E = ΔQ

ηPt = mH

where.

η = efficiency = 84.5 % = 0.845

P = Power = 2.61 KW = 2610 W

t = time = ?

m = mass of water = 6.03 kg

H = Latent heat of vaporization of water = 2.26 x 10⁶ J/kg

Therefore,

(0.845)(2610 W)t = (6.03 kg)(2.26 x 10⁶ J/kg)

t = \frac{1.362\ x\ 10^7\ J}{2205.45\ W}

<u>t = 6179.1 s = 102.9 min = 1.7 h</u>

4 0
3 years ago
Air at p=1 atm enters a long tube of length 2.5 m and diameter of 12 mm at an inlet temperature of Tm,i=100oC and mass flowrate
Annette [7]

Answer:

The heat transfer q = 18.32W

Explanation:

In this question, we are asked to calculate the heat entering the tube and also evaluate properties at T =400K

Please check attachment for complete solution and step by step explanation

6 0
3 years ago
Why doesn’t the servant kill the child oedipus as he was ordered to do
Anni [7]
The Servant does not kill the child Oedipus as he was ordered to do because "He pitied the child" based on the Oedipus Rex story. The servant was ordered to kill the child because of the prophecy that predicted King Laius' death. The king already had attempted to hurt Oedipus by piercing Oedipus's ankle. However, the servant did not finish the job and he rather saved the baby Oedipus.
6 0
3 years ago
Salvage ethnography is the effort to ensure that ethnography remains an important part of anthropology. recording of linguistic
fenix001 [56]

Answer:

                D

Explanation:

                            D

6 0
3 years ago
Other questions:
  • Let suppose, you are going to develop a web-application for school management system. Then what architectural pattern will you u
    9·1 answer
  • given the classes above, what output is produced by the following code? meg[] elements ={new Lois(), new Stewie(), new Meg(), ne
    15·1 answer
  • Which of the following describes fibers? a)- Single crystals with extremely large length-to-diameter ratios. b)- Polycrystalline
    10·1 answer
  • What is 1000 kJ/sec in watts?
    10·1 answer
  • Different Gauss quadrature formulae predict different values for the same integral a. True b. False
    11·1 answer
  • Thermodynamics deals with the macroscopic properties of materials. Scientists can make quantitative predictions about these macr
    13·1 answer
  • 1. What's the maximum overall length of the part?<br> 2. What material is used to fabricate the part
    5·1 answer
  • Is there anyone who can help me with welding?
    7·1 answer
  • 9. An automobile's oxygen sensor output needs
    14·1 answer
  • How many and what type of<br> receptacles are connected to<br> this circuit?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!