C language

Programming Assignment 8: C Interview QuestionsAssigned: Friday, April 13, 2018Due: Wednesday, April 25, 2018 by midnightI. Learner Objectives:At the conclusion of this programming assignment, participants should be able to:Apply and implement all your problems solving and C skills developed this semester!Apply and implement pointers in CManipulate and split arrays and stringsApply and implement recursive functionsII. Prerequisites:Before starting this programming assignment, participants should be able to:Analyze a basic set of requirements and apply top-down design principles for a problemApply repetition structures within an algorithmConstruct while (), for (), or do-while () loops in CCompose C programs consisting of sequential, conditional, and iterative statements Eliminate redundancy within a program by applying loops and functionsCreate structure charts for a given problemOpen and close filesRead, write to, and update filesApply standard library functions: fopen (), fclose (), fscanf (), and fprintf ()Compose decision statements (“if” conditional statements)Create and utilize compound conditionsIII. Overview & Requirements:For this assignment you will be required to write functions which solve each of the following problems. You must place all of your functions in one project. If you use any code that you find online, you must reference it in comments.1.(10 pts) Write a function called my_str_n_cat() that accepts pointer to a destination character array and a pointer to a source character array (which is assumed to be a string) and returns the pointer to the destination character array. This function needs to copy at most n characters, character by character, from the source character array to the end of the destination character array. If a null character is encountered before n characters have been encountered, copying must stop. You may NOT use any functions found in to solve this problem! Note: you MUST use pointer arithmetic in this function only. 2.(10 pts) Recall Binary Search:Input: a list of n sorted integer values and a target valueOutput: True if target value exists in list and location of target value, false otherwiseMethod:Set left to 1 and right to nSet found to falseSet targetindex to -1While found is false and left is less than or equal to rightSet mid to midpoint between left and rightIf target = item at mid then set found to true and set targetindex to midIf target < item then set right to mid – 1If target > item then set to left to mid + 1 Return the targetindexWrite a C function called binary_search().3.(20 pts) Write a function called bubble_sort() that accepts an array of pointers to strings and the number of strings as arguments, and returns nothing. The function sorts the strings according to the following algorithm:1.set the marker U for the unsorted section at the end of the list (U is an integer index value)2.while the unsorted section has more than one element do steps 3 through 73.set the current element marker C at the second element of the list (C is an integer index value)4. while C has not passed U do steps 5 and 65. if the item at position C is less than the item to its left thenexchange these two items6. move C to the right one position7. move U left one position8. stopYour implementation for this function may NOT use strcpy(). You may only exchange or swap pointers, but NOT actually make copies of the strings!4.(15 pts) Write a recursive function called is_palindrome() that accepts a pointer to a string and its length, and recursively determines if the string is a palindrome. The function must return 1 for a palindrome, 0 otherwise. A palindrome is a sequence of symbols that may be interpreted the same forward and backward. For example, “race car”. Note: whitespace should be ignored in your solution.5.(20 pts) Write a recursive function called sum_primes() that accepts an unsigned integer, n, as an argument, and returns the sum of all primes from 2 to n. You must use recursion to solve this problem!6.(25 pts) Write a function called maximum_occurences() that accepts a pointer to a string (consisting of alphanumeric and whitespace characters only), a pointer to an array of struct occurrences, a pointer to an integer, and a pointer to a character as arguments. The structure is defined as follows:typedef struct occurrences{ int num_occurrences; double frequency;} Occurrences;The function determines the frequency of each character found in the array. The frequency is defined as: number of one character symbol / total number of characters. The function should use the second array argument (of struct occurrences) to keep track of the frequency of each character. Also, it must return, through the pointers, the maximum number of occurrences of any one character and the corresponding character for which the maximum represents. Thus, for a string such as “test string”, ‘t’ occurs 3 times, which is the maximum occurrences for any one character in the string.7.(BONUS – 20 pts) Write a function called max_consecutive_integers() that accepts a two-dimensional array of signed integers, the number of rows, the number of columns as input parameters, and two pointers as output parameters (one of these pointers is actually a pointer to a pointer, i.e. two stars!). The function finds the maximum consecutive sequence of one integer. The first pointer stores the address the start of the maximum consecutive sequence of the same integer. The second indirectly stores the number the same consecutive integers in a row. These sequences may wrap from one row to the next. For example ([$xxxx] denotes address value):Row/Column012340-5[$1000]6[$1004]0[$1008]2[$1012]2[$1016]12[$1020]2[$1024]2[$1028]9[$1032]3[$1036]23[$1040]3[$1044]2[$1048]1[$1052]-8[$1056]37[$1060]-2[$1064]6[$1068]0[$1072]4[$1076]The function should store the address of row 0, column 3 ($1012) via the first pointer, and 5 (2, 2, 2, 2, 2) indirectly via the second pointer.IV. Submitting Assignments:Your project must contain one header file (a .h file), two C source files (which must be .c files), and project workspace.Your project must build properly. The most points an assignment can receive if it does not build properly is 65 out of 100.V. Grading Guidelines:This assignment is worth 100 points. Your assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria:95 pts for adherence to the instructions stated above (see the individual points above)5 pts for appropriate top-down design of functions and good styleBONUS: Up to 20 pts for question 7

Don't use plagiarized sources. Get Your Custom Essay on
C language
Just from $13/Page
Order Essay
GradeAcers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Order your essay today and save 15% with the discount code DISCOUNT15