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

Replacing Characters of Sentence

You are given a string 

S. Write a program to replace each letter of the string with the next letter that comes in the English alphabet.

Note: Ensure that while replacing the letters, uppercase should be replaced with uppercase letters, and lowercase should be replaced with lowercase letters.

Input

The first line of input is a string.

Explanation

In the given example, 

Hello World.

If we replace each letter with the letter that comes next in the English alphabet, 

H becomes I, e becomes f and so on ... So, the output should be Ifmmp Xpsme.

Sample Input 1
Hello World
Sample Output 1
Ifmmp Xpsme
Sample Input 2
Something is better than Nothing
Sample Output 2
Tpnfuijoh jt cfuufs uibo Opuijoh

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 . . . . 
. . . 0 0 0 . . . 
. . 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 . 
. . 0 0 0 0 0 . . 
. . . 0 0 0 . . . 
. . . . 0 . . . .
Sample Input 1
5
Sample Output 1
. . . . 0 . . . . 
. . . 0 0 0 . . . 
. . 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0 
. 0 0 0 0 0 0 0 . 
. . 0 0 0 0 0 . . 
. . . 0 0 0 . . . 
. . . . 0 . . . .
Sample Input 2
4
Sample Output 2
. . . 0 . . . 
. . 0 0 0 . . 
. 0 0 0 0 0 . 
0 0 0 0 0 0 0 
. 0 0 0 0 0 . 
. . 0 0 0 . . 
. . . 0 . . .

Diamond Crystal

Given an integer value 

N, write a program to print a diamond pattern of 2*N 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 

2*5 = 10.

So, the output should be

    /\
   /  \
  /    \
 /      \
/        \
\        /
 \      /
  \    /
   \  / 
    \/
Sample Input 1
5
Sample Output 1
    /\
   /  \
  /    \
 /      \
/        \
\        /
 \      /
  \    /
   \  /
    \/
Sample Input 2
3
Sample Output 2
  /\
 /  \
/    \
\    /
 \  /
  \/

Number Diamond

Given an integer 

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

Note: There is a space after each number.

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

    1 
   1 2 
  1 2 3 
 1 2 3 4 
1 2 3 4 5 
 1 2 3 4 
  1 2 3 
   1 2 
    1
Sample Input 1
5
Sample Output 1
    1 
   1 2 
  1 2 3 
 1 2 3 4 
1 2 3 4 5 
 1 2 3 4 
  1 2 3 
   1 2 
    1
Sample Input 2
4
Sample Output 2
   1 
  1 2 
 1 2 3 
1 2 3 4 
 1 2 3 
  1 2 
   1
sample input 3
15
sample output3
              1 
             1 2 
            1 2 3 
           1 2 3 4 
          1 2 3 4 5 
         1 2 3 4 5 6 
        1 2 3 4 5 6 7 
       1 2 3 4 5 6 7 8 
      1 2 3 4 5 6 7 8 9 
     1 2 3 4 5 6 7 8 9 10 
    1 2 3 4 5 6 7 8 9 10 11 
   1 2 3 4 5 6 7 8 9 10 11 12 
  1 2 3 4 5 6 7 8 9 10 11 12 13 
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
  1 2 3 4 5 6 7 8 9 10 11 12 13 
   1 2 3 4 5 6 7 8 9 10 11 12 
    1 2 3 4 5 6 7 8 9 10 11 
     1 2 3 4 5 6 7 8 9 10 
      1 2 3 4 5 6 7 8 9 
       1 2 3 4 5 6 7 8 
        1 2 3 4 5 6 7 
         1 2 3 4 5 6 
          1 2 3 4 5 
           1 2 3 4 
            1 2 3 
             1 2 
              1

Product of the Given Numbers

Given an integer N, write a program which reads N inputs and prints the product of the given input integers.

Input

The first line of input is a positive integer, N. The next N lines each contain an integer.

Output

The output should be the product of the given input integers.

Explanation

In the given example,

N = 3 and the input integers are 2, 3, and 7.So, the output should be 2 x 3 x 7 = 42.

Sample Input 1

3

2

3

7

Sample Output 1

42

Sample Input 2

4

11

2

4

9

Sample Output 2

792




Day Name - 2

Given the weekday of the first day of the month, determine the day of the week of the given date in that month.

Input

The first line is a string D. The second line is an integer N.

Output

The output should be a string.

Explanation

In the given example,

D = Monday. As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will be Sundays (A week has 7 days). So the 16th day (N = 16) of the month will be a Tuesday.

So, the output should be

Tuesday.

Sample Input 1

Monday

16

Sample Output 1

Tuesday

Sample Input 2

Tuesday

17

Sample Output 2

Thursday




Denominations - 2

The possible denominations of currency notes are 100, 50, 20 and 10. The amount A to be withdrawn is given as input. Write a program to break the amount into minimum number of bank notes.

Input

The first line of input is an integer A.

Output

The output should be a string representing number of 100, 50, 20, 10 notes possible.

Explanation

In the given example amount

370, it can be written as370 = 3*(100) + 1*(50) + 1*(20) + 0*(10)Then the output should be


100 Notes: 3

50 Notes: 1

20 Notes: 1

10 Notes: 0


Sample Input 1

370

Sample Output 1

100 Notes: 3

50 Notes: 1

20 Notes: 1

10 Notes: 0

Sample Input 2

130

Sample Output 2

100 Notes: 1

50 Notes: 0

20 Notes: 1

10 Notes: 1




3-digit Armstrong Number

Write a program to check if a given 3-digit number X is an Armstrong number or not.

Note: A number is an Armstrong number if the number is equal to the sum of the Nth power of its digits.

Input

The first line is an integer X.

Output

The output should be a single line containing True if it satisfies the given conditions, False in all other cases.

Explanation

In the given example

X = 371, The number of digits in 371 is 3. So, 33 + 73 + 13 = 371. Hence,

371 is an Armstrong number.

So, the output should be

True.

Sample Input 1

371

Sample Output 1

True

Sample Input 2

351

Sample Output 2

False




Create a program in Python to calculate grade point averages for college students. Grade point averages are calculated by dividing total number of quality points by the total number of earned credit hours. Quality points are grades earned multiplied by the credit hours of a course.  A grade of A is worth 4 points, B is 3 points, C is 2 points, D is 1 point and an F is 0 points. 

Your program should prompt the student to enter their name, total credit hours earned, and total quality points earned.  Calculate the grade point average and display back the student’s name along with their gpa for my example of John Doe. 

Hi John Doe.  Your grade point average is 3.30.   



Paraphrase these three topics you would like to undertake in your course in three (3).(1)Data Compression Algorithms (2)The key aspects for PC games and (3) Neural Networks as a tool of integration of different games





LATEST TUTORIALS
APPROVED BY CLIENTS