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
KatRina [158]
3 years ago
12

Write a simple phonebook program that reads in a series of name-number pairs from the user (that is, name and number on one line

separated by whitespace) and stores them in a Map from Strings to Integers. Then ask the user for a name and return the matching number, or tell the user that the name wasn’t found.
Engineering
1 answer:
Vlad1618 [11]3 years ago
6 0

Answer:

import java.util.HashMap;

import java.util.Map;

import java.util.Scanner;

public class PhoneBook {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       Map<String, String> map = new HashMap<>();

       String name, number, choice;

       do {

           System.out.print("Enter name: ");

           name = in.next();

           System.out.print("Enter number: ");

           number = in.next();

           map.put(name, number);

           System.out.print("Do you want to try again(y or n): ");

           choice = in.next();

       } while (!choice.equalsIgnoreCase("n"));

       System.out.print("Enter name to search for: ");

       name = in.next();

       if (map.containsKey(name)) {

           System.out.println(map.get(name));

       } else {

           System.out.println(name + " is not in the phone book");

       }

   }

}

You might be interested in
What does it mean when it says technology is A dynamic process
Degger [83]

Answer:

It studies the process of technological change. Under the field of Technology Dynamics the process of technological change is explained by taking into account influences from "internal factors" as well as from "external factors

Explanation:

5 0
3 years ago
with a digital system, if you have measured incorrectly and use too low of a kvp for adequate penetration, what do you need to d
Lubov Fominskaja [6]

The x-ray beam's penetrating power is regulated by kVp (beam quality). Every time an exposure is conducted, the x-rays need to be powerful (enough) to sufficiently penetrate through the target area.

<h3>How does kVp impact the exposure to digital receptors?</h3>

The radiation's penetration power and exposure to the image receptor both increase as the kVp value is raised.

<h3>Exposure to the image receptor is enhanced with an increase in kVp, right?</h3>

Due to an increase in photon quantity and penetrability, exposure at the image receptor rises by a factor of five of the change in kVp, doubling the intensity at the detector with a 15% change in kVp.

To know more about kVp visit:-

brainly.com/question/17095191

#SPJ4

5 0
1 year ago
A 200-mm-long strip of metal is stretched in two steps, first to 300 mm and then to 400 mm. Show that the total true strain is t
Neko [114]

Explanation:

For true Strain:

step 1:

E true = Ln(1 + 0.5 ) = 0.40

Step 2:

E true = Ln(1 + 0.33 ) = 0.29

By single step process:

E true = Ln(1 + 1 ) = 0.69

total strain of step process = 0.40 + 0.29 = 0.69 units

SO TRUE STRAIN IS ADDITIVE.

4 0
3 years ago
What are some common work contexts for Licensing Examiners and Inspectors? Select four options.
Akimi4 [234]

According to O*NET, the common work contexts for Licensing Examiners and Inspectors include:

  1. Telephone
  2. Face-to-face discussions
  3. Contact with others
  4. Importance of being exact or accurate.

O*NET is an acronym for occupational information network and it refers to a free resource center or online database that is updated from time to time with several occupational definitions, so as to help the following categories of people understand the current work situation in the United States of America:

  • Workforce development professionals
  • Students
  • Human resource (HR) managers
  • Job seekers
  • Business firms

On O*NET, work contexts are typically used to describe the physical and social elements that are common to a particular profession or occupational work. Also, the less common work contexts are listed toward the bottom while common work contexts are listed toward the top.

According to O*NET, the common work contexts for Licensing Examiners and Inspectors include:

1. Telephone

2. Face-to-face discussions

3. Contact with others

4. Importance of being exact or accurate.

Read more on work contexts here: brainly.com/question/22826220

6 0
2 years ago
Read 2 more answers
Calculate the amount of current flowing through a 75-watt light bulb that is connected to a 120-volt circuit in your home.
vodomira [7]

Answer:

I = 0.625 A

Explanation:

Given that,

Power of the light bulb, P = 75 W

Voltage of the circuit, V = 120 V

We need to find the current flowing through it. We know that, Power is given by :

P=V\times I

I is the electric current

I=\dfrac{P}{V}\\\\I=\dfrac{75\ W}{120\ V}\\\\I=0.625\ A

So, the current is 0.625 A.

5 0
2 years ago
Other questions:
  • The dry unit weight of a soil sample is 14.8 kN/m3.
    12·1 answer
  • Hey, I have a question, I was thinking that if you have engineering skills or drawing skill you could help me to start a project
    15·1 answer
  • Heat in the amount of 100 kJ is transferred directly from a hot reservoir at 1200 K to a cold reservoir at 600 K. Calculate the
    15·1 answer
  • When checking the resistance of a dual voltage wye motor, there should be ____ resistance readings. 1) twelve 2) six 3) three
    12·1 answer
  • An air-conditioning system operates at a total pressure of 1 atm and consists of a heating section and a humidifier that supplie
    15·1 answer
  • A low-resistance path in a circuit, commonly called a _____ can cause a circuit breaker to trip
    7·1 answer
  • Similarity of surface<br>and ground<br>waler​
    9·1 answer
  • Which outcome most accurately portrays the future for the timber company in the following scenario?
    9·1 answer
  • How can I skip more helppppppppppppppppppppppp
    9·2 answers
  • which of the following processes would be appropriate for cutting a narrow slot, less than 0.015 inch wide, in a 3/8- inch thick
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!