WAP to implement a queue using one stack.
WAP to reverse a queue using recursion.
Write a menu driven program to implement Deques (both Input-restricted and
Output-restricted) operations such as Enqueue, Dequeue, Peek, Display of
elements, IsEmpty, IsFull using static array.
Students of 1st year will have choice of going to Physics Cycle or Chemistry Cycle of the academic curriculum. Teacher asks the student to enter the choice. If the choice is p, student is assigned Physics Cycle otherwise Chemistry Cycle. Software needs to be developed with following requirement:
1: Read the choice from the student
2: Check the choice
3: Display appropriate message (Physics Cycle or Chemistry Cycle)
Write a program that
1. Contains a function that displays the content of an integer array starting from the upper
bound on a single line.
2. Contains a function that shits all elements of an integer array by one to the right and
move the last element into the first position. For example, 1 4 9 16 25 would be
transformed into 25 1 4 9 16.
3. Test the functions in (1) and (2) with the aid of an initialized array of your choice in
the main function. Display the array before and after the shifting of the elements.
Write a program that
1. Contains a function that displays the content of an integer array starting from the upper bound on a single line.
2. Contains a function that swaps the first and last elements of an integer array. For
example, 1 4 9 16 25 would be transformed into 25 4 9 16 1.
3. Test the functions in (1) and (2) with the aid of an initialized array of your choice in the main function. Display the array before and after the shifting of the elements.
Using the formulas given below, write a program that:
1. Prompts the user for the size (N) of the data set.
2. Creates an array to store values of the data set.
3. Prompts the user to enter the values of the data set.
4. Receive and save data entered by the user.
5. Display the mean, variance, and standard deviation (sd) of the data set received.
Mean (x–) =(x1 + x2 +......+ XN)/N
Variance =(x1 - x–)² +(x2 - x–) + ..... + (XN - x–)²/N
sd=√variance
Note:
1. You are at liberty to decide what your program should look like when executed. Just ensure the steps above are followed and your grammar and formatting are sound.
2. Solve manually with the data set entered to confirm your program output.
Computer Programming teacher conducts test for 20 marks for 10 students. Teacher wants to know the average marks scored by the students.
Following are requirements to solve the problem
Teacher should have capture the marks scored by the student.
Teacher should compute the average marks scored by the students.
Teacher should display the average marks scored by the students.
Computer Programming teacher conducts test for 20 marks for 10 students. Teacher wants to know the average marks scored by the students.
You are requested to write a program which will be used to take the entry test for university
students. The program must have following features.
• For correct answer, students get 4 marks.
• For wrong answer, student lose 1 mark.
• If the student answers first four questions wrong exit the program with a message “Sorry,
you did not qualify for the admission.”
• If students score 20 marks, program should display “Congratulations, you have qualified for
the admission “and exit.
• There will be only 4 options for each question
Rahul wants to find the cube of integers. Help him to develop a program in C to display the
cube of the number up to given an integer using for loop