Hi.I need help.Got assignment to make these Program but i have no idea how to do this.Please help me it worth 100 marks.I have to submit it by tomorrow.

1.Write a program that asks user to input a character and displays it in the opposite case. That is if a user entered ‘a’, you should display ‘A’, but if user entered ‘A’, you should display ‘a’. However, if the user entered a number like ‘0’ or ‘2’, or enters any other symbol, you should display as it is. 5 marks
Hint: Do NOT use scanf() or getche() for input, because these methods do not give you the ability to not show characters on the screen as user enters them. Instead use getch(). You can use printf(“%c”,val) or putchar(val) to display a character on the screen, where val is a variable of type char. We made a program in assignment 2, which checked if the input character was an UPPERCASE or lowercase letter.

2. Now modify the program in Q1 so that a user can enter as many characters or numbers or symbols he wants but all the characters in small letters are displayed in capital letters. Stop asking for input once the user presses “Enter” key. For example, if a user wants to input, “How many days are there in a Week? There are 7 dAYs.” Your program should display, “HOW MANY DAYS ARE THERE IN A WEEK? THERE ARE 7 DAYS.” 5 marks
Hint: You DO NOT need to use an array at this point. Just use a loop which terminates when the user presses the “Enter” key. Again, do NOT use gets() or scanf() or getche() for input, because these methods do not give you the ability to not show characters on the screen as user enters them. Instead use getch(). Each character you take as input is displayed (after conversion to capital letter, if required) on the screen before you take another input.

3. Now modify the program in Q2 so that you first take input in a char array. Assume the array size to be 80. Your program should ask the user to input a sentence or his favorite quote and press “Enter” when done. Note that you should also make sure that the user does not enter more than 80 characters (i.e. the size of the array) including null terminator (‘\0’). When taking input you should display whatever the user is entering in UPPERCASE letters. After the user is done giving input, you should now display whatever he entered in lowercase letters. A sample output is shown below: 10 marks

Hint: Do NOT use gets() or scanf() or getche() for input, because these methods do not give you the ability to not show characters on the screen as user enters them. Instead use getch().

4. Write a program that compares two strings after ignoring case. That is you want to mimic the functionality of strcmpi() function. For a complete program you should, declare two char arrays s1 and s2. Take input from user in s1 and s2. Then make an element by element comparison of the two strings. Two strings are similar if they satisfy the following two conditions: 10 marks
a. They both have same number of characters.
b. The order of characters in both the strings is same.
For example, “ABCD”, “Abcd”, “aBCd”, “abcd”, etc. are same, but “ABCD”, “ABC”, “ACBD”, “adbc”, “ab”, etc. are not.
Hint: I am providing code for string comparison which is case sensitive. You can modify this to make it case insensitive.

5. Now modify the program of Q4 so that your program compares only first n characters in the two strings after ignoring case. That is you want to mimic the functionality of strncmpi() function. For a complete program you should, declare two char arrays s1 and s2. Take input from user in s1 and s2. Then ask user to input n, which indicates the number of characters to be considered in comparison. Then make an element by element comparison of first n characters in the two strings. The criteria for similarity is as follows: 10 Marks
a. If the lengths of both strings are greater than n, then the two strings are considered same if the characters and their order are same in both the strings for only the first n characters.
b. If the length of any one of the strings is less than n, then:
i. If there lengths are different then they are NOT the same.
ii. If there lengths are same then they ARE same ONLY if ALL of the characters and their order is same.
For example, if we want to compare only the first 4 characters then “STRING”, “String”, “string”, “strings123”, “stri”, “StRiNgS”, etc. are all the same, but “STRING”, “str”, “S1tring”, “STR1NG”, “GNIRTS”, etc. are NOT.
Hint: I am providing code for string comparison which is case sensitive. You can modify this to make it case insensitive and take care of n.

6. Write a program that copies first n characters of a string (char array) into another string (char array). That is you have to write a program that mimics strncpy(dest, src, n) function. For a complete program, you should take input from the user using gets() in a char array of size 80, call it src. Then ask the user to enter the number of characters (n) the user wants to copy into another char array of size 50, call it dest. Make sure you take care of array bounds. That is: your program should be robust to following situations: 20 marks
a. n may be larger than valid number of characters (string length) in src. You can use strlen() function to find the length of a string
b. The user may have entered more than 50 characters as input in src, but dest array is of size 50.

7. Write a program that asks user to input his favorite quote. Then construct a histogram (frequency table) of alphabets. Your program should be insensitive to case of alphabets, i.e. UPPERCASE and lowercase letters are considered to be the same. 20 marks
Hint: We did a histogram program in the class. Use similar logic. Your histogram now has 26 bins, which is equal to number of alphabets in English language.