char string and pointer
$30-5000 USD
Dibayar saat pengiriman
Char String and Pointers 1. Determine the error in the following program: (Type it up and run it!!) #include void main() { cout << "Your name" << endl; cout << "Your Period" << endl; char message[]= {'H', 'e', 'l', 'l', 'o', '\0'}; for(int i = 0; i < 5; i++) { cout << *message << endl; message++; } // THE PROGRAM SHOULD DISPLAY EACH LETTER OF HELLO } (s.c. and code) 2. Write a C++ function that displays the day of the week corresponding to a user-entered input between 1 and 7. That is, in response to an input of 2, the program displays the name Monday. Use an array of pointers in the function. Must have error checking, for numbers between 1 and 7. (s.c. and code) 3. Create three uninitailized character strings in the main. The user will input a three-word sentence, one word for one string. Then, from the main, pass the three strings into a function that uses the concatenation function from string.h. Concatenate the second string and the third string into the first string. Make sure the first string can hold all three words and cout the first string from the function. (s.c. and code) 4. Create two uninitailized character strings in the main. The user will input ONLY two words. You will then pass them into a function that will use the comparison function from string.h. In this function, you will have a char pointer set to null. If the first word is greater than the second, set the char pointer equal to the sentence "First word is greater than the second." Vice versa for second greater than first. If the first and second words are equal, set the char pointer equal to the sentence "First word is equal to the second word." Cout the pointer after the conditions in the function. (s.c. and code)
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
## Platform
must run using microsoft visual C++
ID Proyek: #2943348