Write a main function to test valid id

Assignment Help Programming Languages
Reference no: EM132316019

Assignment -

Write a function valid_id that determines if a Students ID is valid. The function takes one argument, a string. For the purpose of this question a valid id is defined as follows:

  • It is exactly 9 characters long.
  • It begins with an uppercase 'N'.
  • All characters except for the first character must be a digit.

Based on these rules your function will determine if the id is valid and print 'Id is valid' or 'Id is not valid' accordingly.

Here's some examples that use your function:

  • valid_id("N123") will print 'Id is not valid'
  • valid_id("NXYZ!5678") will print 'Id is not valid'
  • valid_id("N12345678") will print 'Id is valid'

Write a main function to test valid_id.

Reference no: EM132316019

Questions Cloud

Evaluate key elements of the strategic planning process : Evaluate key elements of the strategic planning process. Develop an EFE matrix that includes factors, weights, ratings, and total weighted scores.
Evaluate key elements of the strategic planning process : A BCG matrix, also known as a growth-share matrix, identifies departments and divisions within an organization that should receive fewer resources than others.
Write a Java program that will display the given output : Using iteration, write a Java program that will display the following output? 1 3 10 30 100 300 1000 3000 10000 30000
Analyze issues leaders face when interpreting the results : A positioning map helps measure an organization against the competition on two dimensions that are important in the marketplace. Examples could be capacity.
Write a main function to test valid id : Write a function valid_id that determines if a Students ID is valid. The function takes one argument, a string. Write a main function to test valid_id
Describe a possible internal control plan for purchases : Reflecting on the product or service of your current or past employer, discuss how would you mitigate risk for purchases, payroll, and fixed assets?
Analyze the selected not-for-profit financial statements : Analyze the selected not-for-profit's financial statements to determine if the statements conform to Financial Accounting Standards Board (FASB) guidance.
Discuss responsibility for detection and prevention of fraud : Find a court case where fraud occurred over several years (using the KU library/Westlaw), and discuss the responsibility for detection and prevention.
Which form will communication be delivered to stakeholders : 401K- How customer final approval will be received. In which form will communication be delivered to stakeholders?

Reviews

Write a Review

Programming Languages Questions & Answers

  Function to retrieve each of the private data members

Write a class called "Date" with month, day and year as private members. Have constructor that sets default date to 1st January 2000. Have accessor function which retrieves each of the private data members.

  Module program to compare state and county sales tax

Create a module program which will ask the user to enter amount of a purchase. Program must then compare state and county sales tax.

  Create program in pseudocode to compute amount of money

Create the program in pseudocode which computes the amount of money a person would earn over period of time if their salary is one penny first day.

  How does the nist become so relevant

What is an insider threat, and how can this plague system security - how does the NIST become so relevant? Why?

  Write program to enter age using exception handling

Prepare the program called EnterYourAge3.java which asks user to enter his or her age and uses exception handling to catch NumberFormatException in case user enters nonnumeric character.

  Find ultimate gain and period of a proportional controller

You are asked to model three mixing tanks in series. Find the ultimate gain and period of a proportional controller that is to control the outlet composition.

  Dorm and meal plan calculator

GUI Project in Visual Basic.NET - Dorm and Meal Plan Calculator - Create an application with a module and two forms. The module holds defined constants

  Define and initialize tmp mains activation record

Define & initialize tmp main's activation record. When we write the contents of the stack, we write the contents of the whole stack, including previous activation records.

  Create a program that sorts an array of integers

Create a program that sorts an array of integers in ascending order by using a bubble sort. Develop a program that reads in an integer value

  Explain how is recursion and iteration used in programming

question 1 how is recursion and iteration used in programming? provide examples of the various types of recursion and

  Write code using while loop for data validation

Write code or pseudo code using while loops to do Data Validation for following user prompts:input positive # input negative # input number between 1 and 100, inclusive.

  The google corporation

HTML is governed by who? o The Google Corporation. o The Microsoft Corporation. o The American Congress.

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