Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

PetroslavGochev avatar PetroslavGochev 13 Точки

3.Telephony/Interfaces and Abstraction - Exercise - OOP C#

Здравейте група, имам проблем със следната задача:

3.Telephony

You have a business - manufacturing phones. However, you have no software developers, so you call some friends of yours and ask them to help you create a phone software. They have already agreed and you started working on the project. The project consists of two main models – Smartphone and StationaryPhone. Each of your smartphones should have functionalities of calling other phones and browsing in the world wide web. The StationaryPhone can only call other phones.

These friends of yours though are very busy, so you decide to write the code on your own. Here is the mandatory assignment:

You should have a model - Smartphone and two separate functionalities, which your Smartphone has - to call other phones and to browse in the world wide web. You should also have a modelStationaryPhone and one fuctionality which your StationaryPhone has – to call other phones. You should end up with two classes and two interfaces.

Input

The input comes from the console. It will hold two lines:

  • First line: phone numbers to call (string), separated by spaces.
  • Second line: sites to visit (string), separated by spaces.

Output

  • First call all numbers in the order of input then browse all sites in order of input
  • The functionality of calling phones is printing on the console the number which is being called
  • If the number is 10 digits long, you are making a call from your smartphone and you print:

Calling... {number}

  • If the number is 7 digits long, you are making a call from your stationary phone and you print:

Dialing... {number}

  • The functionality of the browser should print on the console the site in format:

Browsing: {site}!

  • If there is a number in the input of the URLs, print: "Invalid URL!" and continue printing the rest of the URLs.
  • If there is a character different from a digit in a number, print: "Invalid number!" and continue to the next number.

Constraints

  • Each site's URL should consist only of letters and symbols (No digits are allowed in the URL address)
  • The phone numbers will always be 7 or 10 digits long

Examples

Input

Output

0882134215 0882134333 0899213421 0558123 3333123

http://softuni.bg http://youtube.com http://www.g00gle.com

Calling... 0882134215

Calling... 0882134333

Calling... 0899213421

Dialing... 0558123

Dialing... 3333123

Browsing: http://softuni.bg!

Browsing: http://youtube.com!

Invalid URL!

 

Judge ми дава 75/100 точки и гърми втори тест с Incorrect answer! 
Прилагам и pastebin към решението : 
https://pastebin.com/QfHhKwVq

Тагове:
1
C# OOP Basics
HristoStantchev avatar HristoStantchev 1 Точки

Виждам, че решението на колегата PetarNeshkov5360 е с изтекъл линк.
След много блъскане на глава решението ми дойде, че втори тест проверява дали си видял за Constraints.
Именно:

Проверява ли се дали телефонният номер е с различна дължина от 7 или 10?

При номер с дължина различна от 7 и 10 да се изпише Invalid number! съобщението.

0
Jem.Enchev avatar Jem.Enchev 0 Точки

Да, прав си. Втори тест следи дали проверяваме дължината на номера.

Спести ми бая главоблъсканици :D

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.