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
vfiekz [6]
3 years ago
11

What is wrong with the following program? #include //Line 1 namespace aaa //Line 2 { const int X = 0; //Line 3 double y; //Line

4 } using namespace std; //Line 5 int main() //Line 6 { y = 34.50; //Line 7 cout << "X = " << X << ", y = " << y << endl; //Line 8 return 0; //Line 9 }
Computers and Technology
1 answer:
Nataly [62]3 years ago
3 0

Answer:

#include //Line 1

namespace aaa //Line 2

{ const int X = 0; //Line 3

double y; //Line 4

}

using namespace std; //Line 5

int main() //Line 6

{ y = 34.50; //Line 7

cout << "X = " << X << ", y = " << y << endl; //Line 8

return 0; //Line 9

}

In Line 1, No header file is present,so it will print output as cout and endl is not defined.

we should include <iostream> header file in line 1  

Lines 7 and 8 are incorrect.

X and y variables in aaa namespace are stated. So we can't use it any other namespace(std), but here y is initialized to 34.50 and x is printed in other namespace rather than stated.

You might be interested in
For a policy to become enforceable, it must meet five criteria, which are?
Karolina [17]

A policy must be distributed, evaluated, understood, consistent, and followed in order to be enforceable.

What is enforceable?

A legally enforceable right of set-off is one that is valid and recognized in all situations (ie enforceable both in the normal course of business and on the default, insolvency or bankruptcy of one of the counterparties).

Distribution denotes that the policy has been made accessible to all personnel for the evaluation process (through events or notification). The second condition defines the content's readability, taking into account the challenges faced by speakers of foreign languages and complex terms (using simple and precise wording to remove uncertainty).

Understanding the terms of the policy is tested through comprehension, and uniform application of the policy is assessed through consistency. Finally, compliance denotes agreement among all parties to abide by the rules.

Learn more about enforceable policy click here:

brainly.com/question/26984272

#SPJ1

8 0
1 year ago
Nina's grades could be better. She gets about five hours of sleep every weeknight and ten hours per night on weekends. How much
aliya0001 [1]

Answer:

a research paper

Explanation:

8 0
3 years ago
Read 2 more answers
Which plot element is typically the turning point in the most intense moment of a story
Valentin [98]

The climax. The climax is when the story peaks and has the most suspense. The story falls closer to it's end after the climax.

4 0
3 years ago
Read 2 more answers
I'm doing a python assignment for my coding class, and the input part just isn't working, someone please help out and tell me wh
tigry1 [53]

,.....,.........mm malds quería saber

8 0
2 years ago
Banks and other financial service companies offer many types of accounts for client's to invest their fund-- every one of them h
monitta

Answer:

//Abstract class declaration of Account

public abstract class Account{

   

   //nextId initialized to 10001

   private static int nextId = 10001;

   private int id;

   private String name;

   // constructor with one argument

   public Account(String passName){

       name = passName;

       //assign the value of nextId to id

       id = nextId;

       //nextId is incremented

       nextId++;

   }

   // accessor method to return id

   public int getId(){

       return id;

   }

   // accessor method to return name

   public String getName(){

       return name;

   }

   //abstract method that return object of type Cash

   //It is not implemented here.

   //It will be overriden and implemented by concrete subclassed

   public abstract Cash getValue();

}

Explanation:

The abstract class Account is defined with the keyword abstract. Then inside the class, we declared and initialized an integer static variable nextId, an instance variable id and a String instance variable name.

A constructor is then defined which accept one argument of a string passName.

Two accessor methods getId and getName are declared. getId return an integer id, while getName return a string name.

Finally, an abstract method getValue is declared with no implementation and it return an object of type Cash.

6 0
4 years ago
Other questions:
  • hey computor guys. is the MSI B250M GAMING PRO LGA 1151 Intel B250 HDMI SATA 6Gb/s USB 3.1 Micro ATX Motherboards - Intel compat
    8·1 answer
  • What is the output of the code snippet given below? string s = "aeiou"; int i = 0; do { system.out.print(s.substring(i, i + 1));
    12·1 answer
  • Which tab allows you to modify the width of a page margins in Microsoft word?
    7·2 answers
  • HURYYYY
    6·2 answers
  • As related to the use of computers, ____ is defined as gaining unauthorized access or obtaining confidential information by taki
    10·1 answer
  • True/False: not is evaluated first; and is evaluated next; or is evaluated last.
    13·1 answer
  • The U.S. military was instrumental in the rise of the simulation training industry.
    11·1 answer
  • Pleaseeeeeeee tellllllllllllllllllllll​
    8·1 answer
  • Can anyone talk to me?
    9·2 answers
  • 1. The opportunity to create several equations for launching program files is called
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!