Negative integer for the telephone number

Assignment Help Basic Computer Science
Reference no: EM132270088

Design and implement a C program which repeatedly asks for a telephone number and validates it

The program exits when the user enters a negative integer for the telephone number. You can assume that the user always enters an integer for a telephone number.

Valid telephone numbers have 11 or 10 digits and follow the format.

FormatTrunk Code - Area Code or Mobile Code - Phone Number

           1      +      3    or    2        +     7          =    11 or 10 digits  

  • Trunk Code: 0
  • Area Code: 200-299 (from 200 to 299 inclusive) which has 3 digits
  • Mobile Code: 32-39, 52, 56, 58, 59, 70, 76-79, 81-99 which has 2 digits
  • Phone Number: 7 digits

If the entered telephone number is valid, print out a message saying that it's valid. In the case it's not valid, print out a message saying that it's invalid and describes the error in details. Here is the list of errors:

  • More than 11 digits
  • Less than 10 digits
  • Invalid trunk code
  • Invalid area code
  • Invalid mobile code

Reference no: EM132270088

Questions Cloud

Introduce the Environmental Hazard - Air Pollution : Submit a draft of your introduction to the environmental hazard you have selected. Environmental Hazard: Air Pollution
Options for computers that do not support pxe boot : What are the options for computers that do not support PXE boot?
Prepare report on data mining in social media : Find at least three related research papers and complete a peer review summary report using APA style, the report should have at least 3 pages not including.
Write a consequential argument paper on john mill''s theory : Write a 4 page consequential argument paper on John Mill's theory on Utilitarianism,principle of utility and greatest happiness relating it Jussie Smollett's ca
Negative integer for the telephone number : The program exits when the user enters a negative integer for the telephone number. You can assume that the user always enters an integer for a telephone number
Count aggregate function and sum aggregate function : What is the difference between the COUNT aggregate function and the SUM aggregate function?
Creating a simple web page using given requirements : EECS1520 This assignment consists of creating a simple web page. The result will be one .html file with the following requirements.
Create a list that contains the months of the year : What would a flowchart look like for: "Create a list that contains the months of the year.
Importance of logging from an information security : What is the purpose of logging, the importance of logging from an Information Security standpoint and how logging can help organizations perform audits

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd