Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

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

Given a string in camel case, write a python program to convert the given string from camel case to snake case.Input


The input will be a single line contain a string.Output


The output should contain the given word in snake case.Explanation


For example, if the given word is "PythonLearning" in camel case, your code should print given word in snake case "python_learning".


Right Triangle

Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below.Input


The input will be a single line containing a positive integer (N).Output


The output should be N rows with numbers.

Note: There is no space between the numbers.Explanation


For example, if the given number of rows is 4,

your code should print the following pattern

1
121
12321
1234321

Alphabetic Symbol

Write a program to print the right alphabetic triangle up to the given N rows.Input


The input will be a single line containing a positive integer (N).Output


The output should be N rows with letters.

Note: There is a space after each letter.Explanation


For example, if the given number of rows is 4,

your code should print the following pattern.

A 
A B 
A B C 
A B C D

One Color

Given a string of length N, made up of only uppercase characters 'R' and 'G', where 'R' stands for Red and 'G' stands for Green. Find out the minimum number of characters you need to change to make the whole string of the same colour.Input


The input will be a single line containing a string.Output


The output should be single line containing the integer representing the minimum number of characters you need to change to make the whole string of the same colour.Explanation


For example, if string is "GGGGGGR" . We need to change only the last character to 'G' to make the string same-coloured.then output is 1.


Special Characters

Write a program to count Vowels and Consonants in string.Input


The input will be a single line containing a string s.Output


The first line of output should contain no of Vowels in the given string

The second line of output should contain no of Consonants in the given stringExplanation


For example, if the given string is "Good Morning"

Vowels in the string "Good Morning" are "o, i" and their count is 4.

Remaining characters in the string are consonants their count is 7.

The First line of output is 4\nThe second line of output is 7.


Evens and Odds

Write a program to count even and odd numbers in given range [M, N]. Both M, N are inclusive in [M, N].Input


The first line of the input will be an integer(M).

The Second line of the input will be an integer(N).Output


The first line of output should be a number of odds count.

The second line of output should be a number of even counts.


Days Conversion

Given a number of days (N) as input, write a program to convert N to years (Y), weeks (W), and days (D).Input


The input will be a single line containing a positive integer (N).Output


The output should be a single line containing years, weeks, days values separated by spaces.Explanation


For example, if the given number of days (N) is 1329.

1329 = 365*3 + 33*7 + 3

So the output is 3 years 33 weeks 3 days


Write three derived classes inheriting functionality of base class person (should have a member function that ask to enter name and age) and with added unique features of student, and employee, and functionality to assign, change and delete records of student and employee. And make one member function for printing address of the objects of classes (base and derived) using this pointer. Create two objects of base class and derived classes each and print the addresses of individual objects. Using calculator, calculate the address space occupied by each object and verify this with address spaces printed by the program


Temperature Conversion

You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales.

Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin.

Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.

Formula to convert from Kelvin K to Celsius C is C = K - 273.

Here "C", "F", "K" represent that the temperature scale is in Celsius, Fahrenheit and Kelvin scales respectively.

The input contains the temperature (a number) and the unit of the temperature scale (C, F, K) without any space.

The output contains temperature in Celsius, Fahrenheit and Kelvin scales in each line in the format similar to input and the value of the temperature is rounded to 2 decimal places


Triplet Sum

Given an array n integers, find and print all the unique triplets (a, b, c) in the array which give the sum K. (a+b+c=K).Input


The output should be multiple lines, each line containing a unique triplet. The elements of the triple must be sorted in increasing order and all the triplets printed must be sorted in increasing order. Print "No Matching Triplets Found" if there are no triplets with the given sum.Explanation


When the given array is [0, 1, 2, 3, 5, 7, 13, 17, 19, 19] and the required sum is 22, the triplets (0, 3, 19), (0, 5, 17), (1, 2, 19), (2, 3, 17) and (2, 7, 13) have the given sum 22.


Sample Input 1

0 12 17 8 9 21

29


Sample Output 1

(0, 8, 21)

(0, 12, 17)

(8, 9, 12)


Sample Input 2

0 1 2 3 5 7 13 17 19 19

22


Sample Output 2

(0, 3, 19)

(0, 5, 17)

(1, 2, 19)

(2, 3, 17)

(2, 7, 13)


The outputs should be exactly as shown in the above samples else test cases not satisfying.

please help me.


LATEST TUTORIALS
APPROVED BY CLIENTS