part 2:
The function should return the number of winners (i.e., the number of participants whose lucky draw number is a multiple of factor-digit and contain the must-have-digit).
Your advised to write a helper function contain_digit(number, digit) that returns True if number contains digit, or False otherwise. Example, function call contain_digit(15, 5) returns True. This function will be called by the find_winners(factor, must_have, n) function to check existence of must_have digit.
part 1: Citizens-of-Zakadaha-hold-an-annual-Gagalafa-festival-to-celebrate-the-harvest-of-their-prized-produce, the-well-sought-after-cocoa-beans-Kokomoko. A-lucky-draw-is-held during-the-festival. Every-participant-is-given-a-lucky draw number. Each year, the organizer decides on two non-zero digits, the factor-digit and the must-have-digit. These two digits need not be distinct. A winning lucky draw number is a number that is a multiple of the factor-digit and contains the must-have-digit. Note that there could be more than one lucky draw winner.
Write function find_winners(factor, must_have, n) that accepts the three parameters:
- Design a C++ program that defines Graph class.
- Represent graph objects by means of linked adjacency lists which are sorted.
- Implement member functions ofthe class to manipulate directed weighted graphs with integer data items.
- main() function should declare and create an object of this class. It should print the value of each node in depth first sequence.
- For your first experiment create such a graph object:
6
10
7 9 8
- Make necessary changes in your program to keep adjacency lists unsorted. Make sure that your search procedures take into account the fact that adjacency lists are unsorted now.
- Present report with results of your experiments: The program code, outputs, some comments on using sorted and unsorted adjacency lists.
y(n) −2.56y(n −1)+2.22y(n−2)−0.65y(n−3) = x(n)+x(n−3)
Write a program that iterates through the odd numbers less than 30, and outputs the square of each number.
Create a program that loops 30 times, but only outputs numbers that are not divisible by 3 or 5. Decide on the most appropriate form of a loop, and use an if statement inside it
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.