Reference no: EM132109208
Programming Project
For this project you are to code two functions that accept C-string parameters.
bool allDigits(char str[])
This function accepts a C-string parameter (null-terminated char array) and return true if the C-string contains only digits. The function is to return false if the C-string contains any other character.
char *firstNonDigit(char str[])
This function accepts a C-string parameter and returns a pointer to the first non- digit that occurs in the string. If the string contains only digits, the function is to return the value null.
The main function for this project is to follow the indicated algorithm:
Repeat
Prompt for an int, read it into a Cstring
If the string contains any illegal (non-digit) characters
Print out an error message that contains the first non-digit of the input
Until a valid string (all digits) is entered
Convert the C-string to an int (the atoi function in the cstdlib library is
handy here)
Print out the int that was input, and also twice that value
You may find the cctype library, as discussed in Section 8.5 helpful in determining if a character is a digit. Alternatively, a digit is simply a character within the range ‘0' - ‘9'.
What is a programming language
: Answer the following Question : What is a programming language?
|
Demonstrate the class with a driver program
: In a course, a teacher gives the following tests and assignments: A lab activity that is observed by the teacher and assigned a numeric score.
|
Write an m-file in matlab which can perform a word search
: Convey how the program was developed, what issues were encountered, whether the program was successful (and if not, why not), etc.
|
Create a patron class for the library
: The class will have a user's name. library card number, and library fees (if owed). Have functions that access this data, as well as a function to set the fee.
|
Print out an error message that contains the first non-digit
: This function accepts a C-string parameter (null-terminated char array) and return true if the C-string contains only digits.
|
Write a public static method named static long tribonacci
: Write a public static method named static long tribonacci(int n, long a, long b, long c)
|
Create an sql or access database with all your friends
: Create an SQL or Access database with all your friends' information and write a program to load the names in the combo box and also search the database.
|
Summarize the recommended instructional strategies
: Summarize and explain how you plan to involve Marias parents in meeting her goals. Include a specific at-home activity to help in her continued success
|
Write a public static method named static long
: Write a public static method named static long fibFast(int n, long a, long b) that returns the nth fibonacci number.
|