. Write an algorithm/pseudocode for a movie rental company that wants to screen their customers from 18years and above. The system should be able to deny access to customers that appear below
Write a program to calculate students’ average test scores and their grades. You may assume the following input data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three arrays: a one-dimensional array to store the students’ names, a (parallel) two-dimensional array to store the test scores, and a parallel onedimensional array to store grades. Your program must contain at least the following functions: a function to read and store data into two arrays, a function to calculate the average test score and grade, and a function to output the results. Have your program also output the class average.
Often some situation arises in programming where data or input is dynamic in nature, i.e. the number of data item keeps changing during program execution. A live scenario where the program is developed to process lists of employees of an organization. The list grows as the names are added and shrink as the names get deleted. With the increase in name the memory allocate space to the list to accommodate additional data items. Such situations in programming require which technique. Explain the concept with the help of suitable examples
Write a program that prints all powers of 2 from 20 up to 220.
Output Segment
1
2
4
8
16
:
:
65536
131072
262144
524288
1048576
Write a program which has a class template for determining the largest and the smallest number
from a list of numbers. Use a constructor for input and appropriate data members and member
functions in support of your answer.
Write a program which has a class called binary which has a character array to store a binary
string. The class decimal derives from class binary and contains an integer data member. Another
class called hexadecimal also derives from binary. Each class should contain constructors and
appropriate data members to input and display the elements. The display function of binary class
displays the binary equivalent, hexadecimal class’s display function displays hexadecimal
equivalent whereas decimal class’s display function displays the decimal equivalent.
Write a program which has an abstract class called Number having an integer data member.
The class contains a pure virtual function called operation. A class called Armstrong is derived from
class called Number. Another class called Palindrome is derived from class Number. Use
appropriate constructors and redefine the function called operation to display if the number is
Armstrong number as well as Palindrome in case it falls in this category. You may make use of
other data members and member functions if needed
Let A is an integer array of size 10 and array A can only accept 10 integers. Check any negative number is found and array out of bound if size of array exceeds. If found throw an exception.
Runtime Input :
10
25
-15
30
22
Output :
Negative Number Exception Caught
Write a class with name ArrayDemo . This class has an array which should be initialized by user as given below. write a function with name display in this class.Call this display function in main function. [4 marks]
-1 4 1 6 3 8 5 10 7 12
a. Write a for loop that prints the ASCII code of each character in a string named S. Use the built-in function ord(character) to convert each character to an ASCII integer.
b. Next, change your loop to compute the sum of the ASCII codes of all characters in a string
4. Use a for loop and the list append method to generate the powers of 2 to produce the following result [1, 2, 4, 8, 16, 32, 64, 128]
5. Write a for loop that prints a dictionary's items in sorted (ascending) order