Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   I need help in the following C problems (http://www.go4expert.com/forums/i-help-following-c-t19812/)

hangulagerson 19Oct2009 15:46

I need help in the following C problems
 
:thinking:1. Write a program to implement a static circular queue. It should include the following functions:
i) Enqueue – To add an element to the end of the queue [4]
ii) Dequeue – To remove an element from the front of the queue [4]
iii) IsEmpty – To check whether a queue is empty or not. [4]
iv) IsFull – to check whether the queue is full or not [4]
v) Display – To display the elements of the queue [4]
2. Implement the following operations for a static list data structure:
i) Front, which returns the contents of the first element in the list [5]
ii) DeleteElem, which deletes a specific element from the list [5]
iii) AddToFront, which connects an element to the front of the list [5]
iv) Append, which adds an element to the end of the list [5]
  • The notepad on the w drive of your machine contains a code that sorts 10 numbers in ascending order. Modify this program to include another function called selection_sort_D that will output the data in descending order. The function, selection_sort_D must be called from the main function. Your final program should then output the two lists in ascending and descending order [20]

  • A palindrome is a word, such as 'madam' or ‘peep’, which reads the same forward and backwards. Write a C program that inputs a word from a user and checks whether it is a palindrome. Your program should then display an appropriate message. [20]

  • Given the name of each salesman, the serial numbers and the total price of all computers sold by each salesman. Write a program that implements functions to achieve the following tasks
i). Use a double-linked list to capture information pertaining to each salesman if there are 7 salesmen at the shop [10]
ii). Calculate the net salary of each salesman if each salesman is paid 21% of the total sales he/she made on top of the $1500 fixed salary. [10]

  • Given the name of each salesman, the serial numbers and the total price of all computers sold by each salesman. Using structures and arrays, write a program that implements functions to achieve the following tasks
i). capture information pertaining to each salesman if there are 7 salesmen at the shop [10]
ii). Calculate the net salary of each salesman if each salesman is paid 21% of the total sales he/she made on top of the $1500 fixed salary. [10]

  • Write a program in C that prompts the user for today’s date (dd, mm and yyyy). Calculate and display the date 37 days from now. Use structures for entering and manipulating dates. [20]

  • A second-degree polynomial in x is given by the expression ax2+bx +c, where a, b, and c are known numbers and a is not equal to zero. Given the values of a, b, c, and x, write a function named poly_two(a, b, c, x) that computes and returns the value of the second-degree polynomial if all the given values are passed by value. Make sure your function poly_two(a,b,c,x) is called from the main() and that it correctly returns the value to main(). The function prototype for poly_two() function must be written in the main() function in such a way that you use printf() to display the value returned. Test the function by passing various data to it.
[20]

xpi0t0s 20Oct2009 12:29

Re: I need help in the following C problems
 
Seems simple enough. What have you got so far and where are you stuck?

If the problem is you haven't got the first clue where to start then I would advise going on a C course to learn the language first.


All times are GMT +5.5. The time now is 20:13.