Questions: 5 831

Answers by our Experts: 5 728

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

Give two polynomials A and B write a program that adds the given two polynomials A and B

Write a program that inputs the length of two pieces of fabric in feet and inches ( as whole numbers) and prints the total

enter the feet: 3

enter the inches: 11

enter the feet: 2

enter the inches : 5


Average of Given Numbers

You are given space-separated integers as input. Write a program to print the average of the given numbers.

Input

The first line of input contains space-separated integers.

Output

The output should be a float value rounded up to two decimal places.

Explanation

In the example, input is 

1, 0, 2, 5, 9, 8. The sum of all numbers present in the list is 25, and their average is 25/6.

So, the output should be 

4.17.

Sample Input 1
1 0 2 5 9 8
Sample Output 1
4.17
Sample Input 2
1 2 3 4 5
Sample Output 2
3.0

input should be single line

Write a program to create a menu-driven calculator that performs basic arithmetic operations (+, -, *, /, and %).Input


The input will be a single line containing two integers and operator(+, -, *, /, and %) similar to 3 + 5.Output


If the given operator is "+", print the sum of two numbers.

If the given operator is "-", print the result of the subtraction of the two numbers.

If the given operator is "*", print the multiplication of the two numbers.



For example, if the given operator is "+" and the two numbers are 3 and 5. As it is an addition operator, your code should print the sum of the given two numbers (3 + 5), which is 8.

Similarly, if the given operator is "*" and the two numbers are 2 and 5.

Similarly, if the given operator is "-" and the two numbers are 10 and 9.


Sample Input 1

3 + 5

Sample Output 1

8

Sample Input 2

2 * 5

Sample Output 2


input will be single line only



In the given example the string is

messages, N = 3. So we have to repeat the string three times. Then we get messages messages messages as output.


Write a program that asks the user for their name and their height in inches ("Enter your name: ", "Enter your height in inches: "). The program should display the person's name and whether they are short, average, or tall. Short is less than 60 inches and tall is greater than 72 inches in between is average height. Display the output in the following format as an example: (Joe, " your height is short")


  1. Write a program to determine and display the greater of two numbers.


‣ Inputs: Two unknown numbers <num1>, <num2>

‣ Output: num1 or num2, whichever is greater


Diamond

Given an integer value

N, write a program to print a number diamond of 2*N -1 rows as shown below.Input

The first line of input is an integer

N.Explanation

In the given example, the number of rows in the diamond is

5.So, the output should be

....0....

...000...

..00000..

.0000000.

000000000

.0000000.

..00000..

...000...

....0....


Digit 9

You are given

N as input. Write a program to print the pattern of 2*N - 1 rows using an asterisk(*) as shown below.Note: There is a space after each asterisk * character.Input

The first line of input is an integer

N.Explanation

In the given example,

N = 4.So, the output should be


* * * *

* *

* *

* * * *

*

*

* * * *


Sample Input 1

4

Sample Output 1

* * * *

* *

* *

* * * *

*

*

* * * *

Sample Input 2

5

Sample Output 2

* * * * *

* *

* *

* *

* * * * *

*

*

*

* * * * *




The media company "GlobalAd" has received a
batch of advertisements from different product
brands. The batch of advertisements is a
numeric value where each digit represents the
number of advertisements the media company
has received from different product brands.
Since the company banners permit only even
numbers of advertisements to be displayed, the
media company needs to know the total
number of advertisements it will be able to
display from the given batch.
Write an algorithm to calculate the total
number of advertisements that will be
displayed from the batch.
Input
The input consists of an integer batch,
representing the batch of advertisements
Output
Print an integer representing the total number
of advertisements that will be displayed by the
media company
Constraints
0 < batchs 109​
LATEST TUTORIALS
APPROVED BY CLIENTS