c laboratory assignment

DESCRIBE THE RELEVANCE OF THOSE CONCEPTS TO YOUR ADVANCING NURSING KNOWLEDGE AND PRACTICE.
April 1, 2021
discussion 1 clinical psych
April 1, 2021

c laboratory assignment

Functions

Create a program that:

  1. Declare a string and assign it an arbitrary starting value of your choosing
  2. Display the current contents of your string, then displays the following menu. If a function returns a string, it should replace the contents of your string, otherwise display the resulting information and leave the string unchanged. Function headers are provided; they should be used as-is in the manner appropriate.
    1. string getInput()
      1. MUST use getline (with cin)
        1. Due to differences in treatment of the n character when we hit enter, cin.ignore may have to be used to fix the input buffer
      2. Reads user input from cin and stores it in the string being used. Contents will set initial state for the string next loop through program.
    2. string printBetween(int a, int b, int step = 1)
      1. Will return a string containing all numbers between a and b, including a and b, counting up
      2. E.G. a = 6, b = 3, output = “3456” (don’t use spaces)
        1. If only two values are provided in the function call, assumes step of 1
      3. Order is unassumed, but data is displayed counting up
    3. string nonalnum_removed(string input)
      1. Returns the string provided as input with all characters that are neither digits nor alphabetic removed
        1. Will probably involve function isalnum (slides/internet for references)
        2. If a string, str, has its length changed, any saved results from str.length() calls will be STALE, meaning they no longer reflect our data
    4. string alphabet_numberified(string input)
      1. Returns the string provided as input, except with (only) alphabetic characters converted to their character codes within the string
        1. “11a11” would become “119711”
    5. int sumDigits(string digitString)
      1. Attempts to read each character as a digit, and returns the sum
      2. Inclusion of non-digit characters should result in a notification (via cout) of the character that could not be summed up
    6. void saveString(string savedStr)
      1. Prints the current string’s contents to a file named <your lab filename>.txt
        1. You can overwrite the previous contents
  3. Asks the user if they would like to return to step 2, or exit.

Points:

1 – Documentation, readability, format

3 – Proper use of functions

2 – Proper program flow (conditionals, loops, etc)

2 – Filename, Header, and Submission Process

1 – Files

1 – Output testing

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers