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
igor_vitrenko [27]
3 years ago
5

What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {

cout << val << endl; } public: TestClass(int x) { val = x; } }; int main() { TestClass test(77); test.showVal(); return 0; }
Computers and Technology
1 answer:
sveticcg [70]3 years ago
5 0

Answer:

The answer to this question is "The program will not compile."

Explanation:

In the given C++ programming language program. The program will not compile because in the program we define a class that is "TestClass" in this class we define a private variable and a function that is val and showVal(). In this function, we print the value of val variable. Then we define a parameterized constructor, in this constructor we use the private variable val that holds the constructor parameter value. Then we define a main function, in the main function we create a class object test which is defined wrong.

That's why the answer to this question is "The program will not compile."  

You might be interested in
Why do astronomers prefer to use the reflecting telescope rather than the refracting telescope to view distant objects in space?
sdas [7]
C is the right answer
7 0
3 years ago
Read 2 more answers
How do I write a good personal narrative pls help im struggling very hard rn.​
statuscvo [17]

Answer: Find out which starter makes your partner most interested in reading your story.

1. Start with action or dialogue.

2. Ask a question or set of questions.

3. Describe the setting so readers can imagine it.

4. Give background information that will interest readers.

5. Introduce yourself to readers in a surprising way.

Explanation:

4 0
3 years ago
Clicking on this will minimize all open windows.
vfiekz [6]
I believe it is the the Show Desktop Icon.
Hope this helps! <3
4 0
3 years ago
Read 2 more answers
Value: 3
Citrus2011 [14]

Answer:

B - A word is correctly spelled but is used incorrectly in a document

4 0
3 years ago
write a program that keeps names and email addresses in a dictionary as key-value pairs. the program should display a menu that
erma4kov [3.2K]

To write a program that keeps names and email addresses in a dictionary as key-value pairs check the code given below.

<h3>What is key-value pairs?</h3>

In a key-value pair, two related data elements are combined: a value, which is a variable that belongs to the set (for example, male/female, green, 100), and a key, which is a constant that defines the data set (for example, gender, color, price).

A key-value pair could look something like this when fully formed:

gender = male

color = green

price > 100

↓↓↓//<u>Python code</u>//↓↓↓

import pickle

import sys

try:

   f=open('email.dat','rb')

   d=pickle.load(f)  

   f.close()

     

except:    

   d={}

while True:

   print('\n1. Find a email address')

   print('2. Add name and email address')

   print('3. Change an email address')

   print('4. Delete an email address')

   print('5. Exit\n')

   choice=input('\nEnter a choice: ')

   if choice:

       choice=int(choice)

   else:

       print('\nEnter a number')

       continue    

   if choice == 1:

       while True:

           name=input('\nEnter the name ')

           if name:

               if name in d:

                   print('\n%s is the email id of %s \n' % (d[name],name))

                   break

               else:

                   print('\n Email not found \n')

                   break

           else:

               print('\nName cannot be empty\n')

               continue

           

   elif choice==2:

       while True:            

       

           name=input('\nEnter the name ')

           if name:

               break;

           else:

               print('\nName cannot be empty \n')

               continue

       while True:            

       

           email=input('\nEnter the email address ')

           if email:

               d[name]=email

               break

           else:

               print('\nEmail cannot be empty\n')

               continue

           

   elif choice==3:

       while True:            

       

           name=input('\nEnter the name to change the email address ')

           if name:

               if name in d:

                   email=input('\nEnter the new email address ')

                   d[name]=email

                   print('\nEmail address changed \n')

                   break;

               else:

                   print('\nName not found \n')

                   break

           else:

               print('\nName cannot be empty \n')

               continue

           

   elif choice == 4:

       while True:            

       

           name=input('\nEnter the name to remove ')

           if name:

               if name in d:

                   del d[name]

                   print('\nName and Email address removed \n ')

                   break;

               else:

                   print('\nName not found \n')

                   break

           else:

               print('\nName cannot be empty\n')

               continue

   elif choice == 5:

       

       f=open('email.dat','wb')

       pickle.dump(d,f)

       f.close()

       sys.exit()

   else:

       print('\nEnter a valid choice ')    

Learn more about key-value pair

brainly.com/question/29414672

#SPJ1

3 0
1 year ago
Other questions:
  • Susan will be configuring a snort network ids sensor to monitor her subnetwork. she will be using a web-based console interface
    8·1 answer
  • The ____ file permission category in unix/linux systems typically entails all permissions and is designated by the letter u.
    7·1 answer
  • true or false? to change document properties, first tap or click file on the ribbon to open the properties view.
    6·2 answers
  • Convert 578.2 into hexadecimal​
    9·1 answer
  • The _________ unit, within the CPU, interprets software instructions and literally tells the other hardware devices what to do,
    5·1 answer
  • An electronic storage file where information is kept is called a cpu. true false
    11·1 answer
  • Hazel has just finished adding pictures to her holiday newsletter. She decides to crop an image. What is cropping an image?
    10·1 answer
  • Write two statements that each use malloc to allocate an int location for each pointer. Sample output for given program:
    7·1 answer
  • Which steps of the management science process can either be a recommended decision or information that helps a manager a decisio
    10·1 answer
  • Any changes done to the software during the operational phase of the software before project wind up is called as maintenance. S
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!