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
charle [14.2K]
3 years ago
9

Which line in the following program will cause a compiler error?

Computers and Technology
1 answer:
kumpel [21]3 years ago
4 0

Answer:

Line number 7.

Explanation:

If I am not wrong, the first line in this question would be #include<iostream>. That is used to add input and output stream of the program.

if we look at the line 1,2,3. These are just the packages/definition required to start a program.

Line 4 starts the main program and line 5 starts the block of main program. The block ends at line 10. So ,there should be no error in line 4,5 and 10.

If we look at line 6, we can see a constant integer(const int MY_VAL = 77) definition and initialization.

The main problem is, you cannot assign a value to a constant (MY_VAL) except during initializing stage.

Therefore, the line 6 is also true. However, this program is further trying to assign a value to constant at line 7. Therefore, the compiler will throw error (ERROR; assigning to const value).

You might be interested in
Headphones are an example of _____.
katen-ka-za [31]
The Answer Is An Output Device 


3 0
3 years ago
Read 2 more answers
When selecting a color scheme for a project which two things should you consider?
Vsevolod [243]

colorfulness and depending on your teacher pick colors that will go together on the project

6 0
3 years ago
Select the correct answer.
Vitek1552 [10]

Answer:

I think it's C. but not a 100%

6 0
3 years ago
Read 2 more answers
Given: an int variable k, an int array current Members that has been declared and initialized, an int variable memberID that has
Alekssandra [29.7K]

Answer:

The c++ program is given below. Nothing is displayed as per the question.

#include <iostream>

using namespace std;

int main() {    

   // declaration and initialization of integer variables

   int k, memberID = 12, nMembers=5;

   bool isAMember;    

   // declaration and initialization of integer array

   int currentMembers[] = {12, 34, 56, 78, 90};    

   for(k=0; k<nMembers; k++)

   {

       if(memberID == currentMembers[k])

       {

           // when member is found in the array, the loop is exited using break

           isAMember = true;

           break;

       }

       else

           isAMember = false;

   }    

   return 0;

}

Explanation:

The program begins with declaration and initialization of integer variables and followed by initialization of the array holding the id of all the members.

The Boolean variable is declared but not initialized.

int k, memberID = 12, nMembers=5;

bool isAMember;

int currentMembers[] = {12, 34, 56, 78, 90};

After this, the array holding the id of the members is searched for the given member id. This is done using  a for loop and a if else statement inside the loop.

If the member id is present in the array, the variable isAMember is initialized to true otherwise it is assigned false.

When the variable isAMember is initialized to true, the break statement is used to exit from the loop.

for(k=0; k<nMembers; k++)

   {

       if(memberID == currentMembers[k])

       {

           isAMember = true;

           break;

       }

       else

           isAMember = false;

 }

The break is used since other values of id in the array will not match the given member id and the variable, isAMember will be initialized to false even if the given member id is present in the array. Hence, it is mandatory to exit the loop once the given member id is found in the array.

This program can be tested for different values of the id of the members and different sizes of the array.

4 0
4 years ago
In the ____ letter style, all components of the letter begin flush with the left margin.
Sedaia [141]
In the block <span>letter style, all components of the letter begin flush with the left margin.</span>
4 0
3 years ago
Other questions:
  • The ____ is a new feature in versions of microsoft office, starting with office 2007; it consists of tabs, which contain groups
    5·1 answer
  • O novo funcionário da equipe de desenvolvimento de sistemas está aprendendo os termos mais utilizados no dia a dia da empresa. A
    7·1 answer
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • Which is the best description of the laws governing IT professionals?
    5·1 answer
  • Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
    7·1 answer
  • Consider the code fragment below. Show the values stored at each location in memory and as they change while the code executes.
    5·1 answer
  • In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 and
    13·1 answer
  • TRUE AND FALSE
    10·1 answer
  • While developing a network application, a programmer adds functionally that allows her to access the running program without aut
    14·1 answer
  • A leading global vendor of computer software, hardware for computer, mobile and gaming systems, and
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!