Create a program that uses a do-while loop to count the number of characters (not including whitespace) entered by the user. The count should end when it first encounters a # character in the input.
Write a program that reads a character and then prints “It is a vowel”, if it is a vowel, “It is an operator”, if it is one of the five operators, and “It is something else”, if it is anything else.
Write a program to calculate mobile phone charges according to the following packages. 1. One Hour Package (Package A): If the customer talks for one hour (60 minutes) then Rs. 10 will be charged for one hour (60 minutes) and Rs. 2 will be charged for every extra minute after 60 minutes. 2. 20 Minutes Package (Package B): Rs. 1 will be charged for the first 20 minutes and for every extra minute Rs. 2.5 will be charged. 3. No Package (Package N): Rs. 2 per minute will be charged.
- Design a C++ program that solves Hanoi towers problem
- Experiment with your program , using n=3, n=10, n=20, n=60; and register the number of disk moves required for Hanoi towers problem solution for each value of n and approximate run times.
- Trace execution of your algorithm for n=3 by making a tree of function calls.
- What is the time-efficiency class of your algorithm?
- Design a C++ program with a ListArray class of unordered lists with integer items. main() function should declare an object of this class. It should print the content of the list after execution of each list operation.
- Make necessary changes in your program to keep lists sorted in ascending order and then in descending order. Make sure that your search function effectively uses the fact that a list is sorted now.
- Design three additional methods:
1. itemsSum() that returns the sum of list items.
2. invert_move() that inverts the sequence of list items in the same list by changing items memory locations.
3. invert_move() that inverts the sequence of list items in the same list without changing items memory locations.
- Present report with results of your experiments: The program code, outputs, some comments on additional functions 2 and 3.
One dimensional Array.
The program will ask the user to input size of the array, and the user will input values for each index.The program will output the LARGEST inputted value and its index.
Ten students had worked in a clothing store during the holidays. At the end of
the holiday, they receive a wage according to the number of items that they
sold. The rate of pay is R6.50 per item. Enter the student name and the
number of items that the student sold during the holidays and display the
student name and the amount earned by every student. Also calculate and
display the student name of the student who sold the most items.
Write a function Lagrange_interp which implements Lagrange interpolation to find data at an intermediate data point. Note: The degree of the polynomial will not be known to you unless the problem statement is given. The function should be able to deal with N data points. You can either use dynamic memory allocation for data storage in arrays or in a simpler approach, you may declare the array sizes as a large value.
Write a function Lagrange_interp which implements Lagrange interpolation to find data at an
intermediate data point.
Note: The degree of the polynomial will not be known to you unless the problem statement is given.
The function should be able to deal with N data points. You can either use dynamic memory allocation
for data storage in arrays or in a simpler approach, you may declare the array sizes as a large value.