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

  Create a world with a wind-up penguin

Create a world with a wind-up penguin. This is actually a penguin (Animals) with a wind Up Key (Objects) positioned against its back. The key is vehicle property has been set to the penguin. In this world, make the penguin waddle (or walk) around ..

  Harnessing information management,data, and infrastructure

Harnessing Information Management, the Data, and Infrastructure.Ascertain the importance of information management for the company or industry that you have chosen.Analyze the fundamental impact of IT architecture or enterprise architecture on inform..

  Draw pictures of the list names afte

Draw pictures of the list names after each line of the following code. Show the head pointer of the list, and the values and next pointers of every node. Draw pointers as arrows, and the null pointer as a slash or X. You may assume the list is sin..

  Process improves the network design and user satisfaction

Identify specific tools that can be used to assist in determining performance requirements as part of the analysis. Identify the appropriate stakeholders that should be included in developing each section.

  Confidence interval about the mean age

Several years ago the mean age of an inmate on death-row was 39.3. To check and see if the mean age of an inmate on death-row has changed

  Shareholders exercise rights

Which of the following rights schemes will raise the most money, if all shareholders exercise their rights?

  Why is rand function useful for simulating games of chance

Why would you randomize a program by using srand ? Under what circumstances is it desirable not to randomize?

  Create the tables and relationship in access

If you were given an ERD that contained a M:N relationship between orders and products, what would you need to do in order to create the tables and relationship in Access?

  What are the deliverables at analysis phase

System analysis and design. 1. What are the deliverables at analysis phase? 2. What is the difference between the close-end and open-end question?

  Effect on national savings than a temporary increase

A permanent increase in government purchases has a larger effect on national savings than a temporary increase of the same amount

  What are the advantages of a web server

What are the advantages of a Web server?

  Question regarding the minimum score

What is the minimum score she must recieve on the fifth test to have an overall test score average that is greater than or equal to 90? (Set up and solve an inequality to answer this question).

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