Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TestExample28112021
- {
- class Program
- {
- static void Main(string[] args)
- {
- PhoneBook book;
- book = new PhoneBook();
- for (int i = 0; i < 15; i++)
- {
- string name, city;
- int phone;
- Console.Write("enter contact name: ");
- name = Console.ReadLine();
- Console.Write("enter contact city: ");
- city = Console.ReadLine();
- Console.Write("enter contact phone: ");
- phone = Convert.ToInt32(Console.ReadLine());
- //phone = int.Parse(Console.ReadLine());
- Contact contact = new Contact(name, phone, city);
- book.add(contact);
- }
- Console.WriteLine("Number of contacts from haifa is {0}", book.count("Haifa"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement