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
Nataly_w [17]
3 years ago
13

What error occurs in the following program? #include using namespace std; int main() { int number1, number2, sum; cout <<

"Enter number 1:"; cin >> number1; cout << "Enter number 2:"; cin >> number2; number1 + number2 = sum; cout << "The sum of number 1 and number 2 is " << sum; return 0; }
Computers and Technology
1 answer:
Nady [450]3 years ago
7 0

Answer:

1. ‘cout’ was not declared in this scope.

2. ‘cin’ was not declared in this scope.

3. lvalue required as left operand of assignment.

Explanation:

The code gives the error cout and cin was not declare. This error means, we not include the library where they define.

cout and cin is the input/output instruction and they include in the library iostream file.

the last error is lvalue required as left operand of assignment.

lvalue means the assignable value, we actually do the wrong assignment.

number1 + number2 = sum;

here, sum is is the assignment variable. so, it must be in the right side of the '=' operator.

sum = number1 + number2 ;

Now, the above is correct. the value number1 plus number2 is assign to sum.

You might be interested in
Greg is writing a report on becoming an advertising and promotions manager. Complete the report by correctly filling in the miss
zzz [600]

Since Greg wants to become an advertising and promotions manager, he needs to at least gain a (B) bachelor’s degree level of education, since generally, this educational background is expected from individuals who wishes to work in an entry-level position in the field of advertising.

One of the skills that he also needs to develop is (C) communication skills, because he would have to be able to communicate in both written and spoken to develop the advertisements according to the client’s desires.

8 0
3 years ago
What is one purpose of an algorithm
adelina 88 [10]

Answer:

Algorithms is formula for solving a problem. It is helpful because it specifically give instructions detail to computer to what a computer should perform a specific task.

For e.g. calculating report cards.

4 0
3 years ago
________ a database rearranges data and objects in a database to make its size smaller
hodyreva [135]
<span>An attribute in a relation of a database that serves as the primary key of another relation in the same database is called a

</span>
8 0
3 years ago
. Is it conceivable to design a secure operating system for these computer systems? Give arguments for and against.
Lena [83]

Answer:

A favor:  porque permite manejar la memoria, disco, medios de almacenamiento de información y los diferentes periféricos o recursos de nuestra computadora, como son el teclado, el mouse, la impresora, la placa de red, entre otros.

En contra:

Si uno llega a fallar con un codigo en algun sistema puede verse afectado el dispositivo

Explanation:

8 0
3 years ago
Consider the following class declaration: public class Square { private double sideLength; public double getArea() { return side
kipiarov [429]

Answer:

Here is the constructor:

public Square(double s) {  //constructor name is same as class name

sideLength = s;  } //s copied into sideLength field

Explanation:

The above constructor is a parameterized constructor which takes a double type variable s as argument. The name of constructor is same as the name of class.This constructor requires one parameters. This means that all declarations of Square objects must pass one argument to the Square() constructor as constructor Square() is called based on the number and types of the arguments passed and the argument passed should be one and of type double.

Here is where the constructor fits:

public class Square {

private double sideLength;

public Square(double s) {  

sideLength = s;  }

public double getArea() {

return sideLength * sideLength;}

public double getSideLength() {

return sideLength; } }

4 0
3 years ago
Other questions:
  • What does enterprise operating system mean?
    13·1 answer
  • "list at least 3 key performance indicators that should be considered prior to initiating a cloud deployment."
    15·1 answer
  • 350 square feet requires 1 gallon of paint. Assign gallons_paint with the amount of paint required for wall_area. Sample output
    12·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    5·1 answer
  • What language must be used to display a bare-minimum webpage?
    8·2 answers
  • Arrange the types of movies in terms of the amount of content they can hold
    14·1 answer
  • What animal is perry the platypus ​
    6·2 answers
  • Which of these is a valid use of the Reply All feature?
    11·1 answer
  • I need help for my computer science class I would appreciate it
    11·1 answer
  • Identify the calculation performed by the following code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!