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
Write a class named Sorting with sort function in order to sort the following array as program. Call sort function in main function. [4 marks]
char[] j= {'r', 'g', 'o', 'm', 'r', 'p','a'};
output display as “program”
Given a list of integers, write a program to identify the contiguous sub-list that has the largest sum and print the sum. Any non-empty slice of the list with step size 1 can be considered as a contiguous sub-list.Input
The input will contain space-separated integers, denoting the elements of the list.Output
The output should be an integer.Explanation
For example, if the given list is [2, -4, 5, -1, 2, -3], then all the possible contiguous sub-lists will be,
[2]
[2, -4]
[2, -4, 5]
[2, -4, 5, -1]
[2, -4, 5, -1, 2]
[2, -4, 5, -1, 2, -3]
[-4]
[-4, 5]
[-4, 5, -1]
[-4, 5, -1, 2]
[-4, 5, -1, 2, -3]
[5]
[5, -1]
[5, -1, 2]
[5, -1, 2, -3]
[-1]
[-1, 2]
[-1, 2, -3]
[2]
[2, -3]
[-3]Among the above contiguous sub-lists, the contiguous sub-list [5, -1, 2] has the largest sum which is 6.
Sample Input 1
2 -4 5 -1 2 -3
Sample Output 1
6
Sample Input 2
-2 -3 4 -1 -2 1 5 -3
Sample Output 2
7
ABC private Ltd wants to maintain Employee’s Information. You need to define an Entity class to hold Employee Information and generate a DLL. You also need to test this class usage by writing a Console application as a client.
Task 1: Define a class called “Employee” with the following fields: EmployeeId, Employee Name, Address, City, Department, Salary Define the functions to set the values of each property and to get the value of the Salary in the class: Compile the class to generate a DLL.
Task 2: Create a Console application and use this class. Create an object of this class. Accept the values from the user and assign the members.
Task 3: Modify the console application to define an array of objects to hold 10 records of Employee. Accept the details of 10 employees from the user using a loop. Display the Employee Name and Salary of all the employees.
Task 4: Modify the class to add properties using get, set blocks. Modify the console application to use the properties.
Smallest Missing Number
Given a list of numbers, write a program to print the smallest positive integer missing in the given numbers.
Input
The input will be a single line containing numbers separated by space.
Output
The output should be a single line containing the smallest missing number from given numbers.
Explanation
For example, if the input numbers are 3, 1, 2, 5, 3, 7, 7.
The number 1, 2, 3 are present. But the number 4 is not. So 4 is the smallest positive integers that is missing from the given numbers.
Sample Input 1
3 1 2 5 3 7 7
Sample Output 1
4
Sample Input 2
5 5 2 3 1 8 8 4
Sample Output 2
6
Secret Message - 2
Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.
a b c d e f g h i j k l m n o p q r s t u v w x y z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Input
Input will be a string in single line containing spaces and letters both uppercase and lowercase.
Output
Output should be a single line containing secret message. All characters in output should be in lower case.
Explanation
For example, if input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So output be "16-25-20-8-15-14".
Sample Input 1
python
Sample Output 1
16-25-20-8-15-14
Sample Input 2
python learning
Sample Output 2
16-25-20-8-15-14 12-5-1-18-14-9-14-7) Create a program that ask user to input their weight. Imagine that the user was standing on the moon right now, his/her weight would be 16.5 percent of what it is on Earth. If he/she gained a kilo in weight every year for the next 15 years, what would his/her weight be for each year of the 15 years? Write a program using a for loop that prints the user moon weight for each year.
what is network byte order?
You
are required to design a software for a vehicle showroom to manage its
activities. Given the following requirements:
The showroom has a name, address
and sales tax number. The showroom sells cars and trucks. Car has a
manufacturer, model and number of doors, truck has a manufacturer, model and
loading capacity.
You
are required to design a software for a vehicle showroom to manage its
activities. Given the following requirements:
The showroom has a name, address
and sales tax number. The showroom sells cars and trucks. Car has a
manufacturer, model and number of doors, truck has a manufacturer, model and
loading capacity.