Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a C++ program that takes an integer input and returns the following number.


More distinct letters

you are given a list of strings, write a program to print the string with the maximum number of distinct letters. If there are more than one such strings, print the string which comes first in alphabetical order. Note: consider upper and lower case letters are different.

Input: The input is a single line containing the strings separated by a space.

Output: The output should be a single line containing the string with maximum distinct characters.

Explanation:

In the example, the given list of strings are raju , plays , golf. The word plays has the maximum number of distinct letters. So the output should be plays.


Max Contiguous Subarray

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

Develop an application in Java for automating the Banking Operations using interfaces.

Create an interface called “Transaction” which contains the functions such as deposit,

withdraw, and viewBalance. Create another interface called “Displayable” which

contains the Display () function to display the account details.

Create an abstract class called “Account” with bank account details such as acc_name,

acc_no, and balance. Add necessary constructors.

Create a “Bank” class which implements the “Transaction”, “Displayable” interfaces

and inherits “Account” class.

Perform menu driven operations like Deposit, Withdraw and Balance Enquiry, View

Account Details from a Main class. Write logics in the corresponding methods.


Column Title
You are given a number that denotes a column in the Excel Sheet, write a program to calculate the column name in the Excel Sheet. The naming of columns in the Excel Sheet is as follows
Column Name Column Number
A 1
B 2
C 3
... ...
X 24
Y 25
Z 26
AA 27
AB 28
... ...
BA 53
... ...
ZZ 702
AAA 703
... ...
Input
The first line of input is a positive integer.
Output
The output should be a single line containing the column name.
Explanation
For example, if the given column number is 42.
The column names with single alphabets end at 26. Further column names will contain two alphabets.
Therefore, for the column number 42, the first alphabet in the column name is A and the remaining number is (42-26) is 16.
The second alphabet of the column name is the 16th alphabet, which is P.
So, the output should be AP.
def product(a,b):
    c=a+b
    return c
x=int(input("enter product"))
y=int(input(("enter price"))
print(product(x,y))




a c++ program that reads 5 scores and how much each scores differ from the the highest score 


List the binary, octal and hexadecimal numbers :


DECIMAL:

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31


BINARY:

OCTAL :

HEXADECIMAL :


Suppose there is XYZ Company and there are different departments like production, marketing, finance, sales etc. Manager of the company want to know about the detail of the employees who are highly paid in each of the department. Write a program using the concept of classes to implement the same
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that every positive integer that has an exponent of 0 is a power of "1". This includes "0" and "1", itself.

After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print("is_power(10, 2) returns: ", is_power(10, 2))

print("is_power(27, 3) returns: ", is_power(27, 3))

print("is_power(1, 1) returns: ", is_power(1, 1))

print("is_power(10, 1) returns: ", is_power(10, 1))

print("is_power(3, 3) returns: ", is_power(3, 3))
LATEST TUTORIALS
APPROVED BY CLIENTS