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

Write a C++ program that performs the four arithmetic operations (addition, subtraction, multiplication and division) on two numbers received from keyboard by prompting. Your program must have specific function for each arithmetic operation. 


Create a class named Fruit with a data member to calculate the number of fruits in a basket. Create two other class named Apples and Mangoes derived from class Fruit to calculate the number of apples and mangoes in the basket. Print the number of fruits of each type and the total number of fruits in the basket. 


Write a program to count the palindromic array elements from the group of 30 array elements where array is allocated memory dynamically.


Get an integer from the user and check if it is divisible by 2. Print appropriate message on the screen


Declare two variables a and b to store values 2.1 and 6.4. Declare another variable c and assign it the result of a * b.


Use a for loop and the list append method to generate the powers of 2 to produce the following result [1, 2, 4, 8, 16, 32, 64, 128]


Write a for loop that prints a dictionary's items in sorted (ascending) order


a. Write a for loop that prints the ASCII code of each character in a string named S. Use the built-in function ord(character) to convert each character to an ASCII integer.

b. Next, change your loop to compute the sum of the ASCII codes of all characters in a string


At the interactive prompt, define a list named L that contains four strings or numbers (e.g., L=[0,1,2,3]). a. What happens when you try to index out of bounds (e.g., L[4])?

b. What about slicing out of bounds (e.g., L[-1000:100])?

c. Finally, how does Python handle it if you try to extract a sequence in reverse—with the lower bound greater than the higher bound (e.g., L[3:1])? Hint: try assigning to this slice(L[3:1]=[‘?’]) and see where the value is put


. Type the expressions below in python interactively, and try to explain what's
happening in each case:
a. 2 ** 16
2 / 5, 2 / 5.0

b. "spam" + "eggs"
S = "ham"
"eggs " + S
S * 5
S[:0]
"green %s and %s" % ("eggs", S)
c. ('x',) [0]
('x', 'y') [1]

d. L = [1,2,3] + [4,5,6]
L, L[:], L[:0], L[-2], L[-2:]
([1,2,3] + [4,5,6]) [2:4]
[L[2], L[3]]
L.reverse(); L
L.sort(); L
L.index(4)
LATEST TUTORIALS
APPROVED BY CLIENTS