Acceptkey" Function Method Valid Key Array IT Assignment Help

Download Solution Order New Solution
Assignment Task


Task

1.Write a function named "acceptKey" that accepts an array of valid keys
and its size. The method will read in a key from the user
and check whether the user has entered one of the valid keys in the given array or not.
If not, it will allow the user to try up to 3 times. If the user was able to enter the expected
key number within 3 tries, it will return true. Otherwise, it returns false and key value of 0.
In addition, it also returned the key to the caller.
For example, assuming the given valid key array contains {111, 222, 333, 444}
here are 2 different sets of runs:
Please enter your key: 123
Please enter your key: 456
Please enter your key: 789
Return false and the returned key of 0
Please enter your key: 123
Please enter your key: 456
Please enter your key: 444
Return true and the returned key of 444
Requirement: please use only pointer notation. No array notation.
The use of pass-by-reference parameters is also not allowed. Use pointer parameters instead.
2. Write a function named “isNumberString” that accepts a C-string (an array of characters
with a NULL terminating character)and returns true
if that C-string contains a valid integer number and false otherwise.
A valid number string is defined as a string starting with an optional sign of '+' or
'-' and contains only digits after that.
For example, "123456" or "+1234" will return true and 1
"-4567" will return true and -1
"0" will return true and 0
"123A" will return false and 0
"A456" will return false and 0
The requirement is that you cannot use any string conversion function or
method such as strtoi or strlen. You are required to do the check yourself
by examining each character in the C-string and
performing the validity check in the method.
 

    


This IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
    
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.