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
anastassius [24]
3 years ago
15

A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the

first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Use the following names and phone numbers: Name Phone # Gina (847) 341-0912 Marcia (847) 341-2392 Rita (847) 354-0654 Jennifer (414) 234-0912 Fred (414) 435-6567 Neil (608) 123-0904 Judy (608) 435-0434 Arlene (608) 123-0312 LaWanda (920) 787-9813 Deepak (930) 412-0991
Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
4 0

Answer:

# include <iostream.h>

# include <stdio.h>

# include <string.h>

using namespace std;

class citizen

{      

    int i;

    public string name[30];

    public long int phonenumber[30];

    public void addindividual(string name1)

     {      

           If (i<=30)

            {     int flag=0;

                  for(int j=0; j<=i;j++)

                  {

                     if (strcmp(name[i], name1)

                      {

                          flag=1;

                      }

                     else

                     {  

                           flag=0;

                     }

                  }

                  If (flag)

                 {

                  if (i<30)

                  {

                  for(j=i+1;j<=30; j++)

                  {

                        cout<<"Enter the name:"; getchar(name[j]);

                        cout<<"Enter the phone number:"; cin>>phonenumber[j];

                         i++;

                   }

                  else  

                   {

                        cout<<"The person already exists";

                        exit();

                   }

              }

            else

             {

                 cout<<"array is full:";

                 exit();

             }

     }

}

Void main()

{

     string str;

    cout<<" Enter name:";

    getline(cin, str); ;

     citizen c1=new citizen();

     c1.addindividual(name1);

}

Explanation:

With a little more effort you can make the program allow the user to enter any number of details, but less than 30 overall. We have used here flag, and as a programmer we know why we use the Flag. It is used to check whether certain Boolean condition is fulfilled or not. Here, we are checking whether a given name is present in the array of names, and if it is not present, we add that to the list. And if the name is present, we print, it already exist.

You might be interested in
After installing an update on her MacBook, a user contacts the technician to complain that the WiFi is not working. The WiFi ico
GarryVolchara [31]

Answer:

The correct answer to the following question will be "PRAM needs to be reset".

Explanation:

<u>PRAM:</u>

  • It is commonly known as "Parameter Random Access Memory". It is a memory that is used to store the settings of the system of a Mac OS. These settings comprise of monitor settings, speaking settings, WI-FI settings, etc.
  • So, according to the given case when the WI-FI icon shows that the system is connected to the internet but he is not able to browse the internet. In this case, he needs to reset the PRAM to browse the internet.

So that the above is the right answer.

4 0
3 years ago
If you’d like to have multiple italicized words in your document, how would you change the font of each of these words
Alex787 [66]

Answer:

Use styles and modify the font of the default style

Explanation:

4 0
2 years ago
Convert the following MIPS assembly code snippet into machine language (hex). Write the code in a memory arrangement (address -
Snezhnost [94]

Answer:

Check the exlanation

Explanation:

1) add $s0,$s0,$s1 \rightarrow R-format

   

opcode                 rs        rt      rd          shamt      function

000000            $s0       $s1    $s0        00000    100000

000000            10000  10001  10000    00000  100000

  = 0X42118020

2) lw $s0,0X20($t7)\rightarrow I-format

opcode                     rs      rt            offset

100000                  $s0     $t7          0X20

100000               10000    01111       0000000000010000

  = 0X820F0010

3) addi $s0,$s0,-10 \rightarrow I-format

opcode             rs           rt            offset

001000            $s0         $s0       -10

001000             10000   10000    1111111111110110

= 0X2210FFF6

4) ori $s1,$a0,100 \rightarrow I-format

opcode             rs        rt            offset

001101             $s0     $a0         100

001101            10000  00100    0000000001100100

= 0X36040064

5) j 0X400C \rightarrow J-format

opcode  rs

000010  0X400C

000010  0000000000100000000001100

= 0X0800400C

4 0
3 years ago
Through the use of _____, pilots can simulate flights without ever leaving the ground.
Doss [256]
Your answer is:
virtual reality

I hope this helps! :)
7 0
3 years ago
Which act will the person be punished by trying to obtain personal information employees illegally?
solong [7]

Jail or something worse

3 0
3 years ago
Other questions:
  • What is data security
    14·1 answer
  • Write a program that inputs an integer denoting a month (1 for January, 2 for February, ... , 12 for December), and outputs how
    8·1 answer
  • A set of programs that enable the hardware to process data is _____.
    12·1 answer
  • JAVA
    7·1 answer
  • Examples of application software​
    7·2 answers
  • List two examples of following types of communication
    15·2 answers
  • What is the relationship between agile teams and project requirements
    9·1 answer
  • Queries are questions true or false?
    9·1 answer
  • Please help me on this match all this up i’ll give you brainlist
    13·2 answers
  • The technique that allows you to have multiple logical lans operating on the same physical equipment is known as a.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!