# I need help in the following C problems

Discussion in 'C' started by hangulagerson, Oct 19, 2009.

1. ### hangulagersonNew Member

Joined:
Oct 19, 2009
Messages:
1
0
Trophy Points:
0
: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 
ii) Dequeue – To remove an element from the front of the queue 
iii) IsEmpty – To check whether a queue is empty or not. 
iv) IsFull – to check whether the queue is full or not 
v) Display – To display the elements of the queue 
2. Implement the following operations for a static list data structure:
i) Front, which returns the contents of the first element in the list 
ii) DeleteElem, which deletes a specific element from the list 
iii) AddToFront, which connects an element to the front of the list 
iv) Append, which adds an element to the end of the list 

• 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 

• 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. 

• 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 
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. 

• 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 
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. 

• 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. 

• 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.


Joined:
Aug 6, 2004
Messages:
3,009