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 program that will read an arbitrary number of sets of triangle sides using only integer values. 

  1. Prompt the user for sets of numbers and process them until the user submits the numbers 0 0 0, which will terminate the program.
  2. For each set of three numbers, the program should print the values read.
  3. For each set of three numbers, the program should decide if the numbers represent the sides of a valid triangle.
  4. If the numbers could not represent a valid triangle, display an appropriate error message.
  5. If the numbers are valid, the program should determine, and display, the:
  6. classify sides of the triangle – equilateral, isosceles, or scalene
  7. classify angles of the triangle – right, acute, or obtuse

You need to have functions for the following tasks:

  1. do the 3 side length form a triangle
  2. classify the triangle by side lengths
  3. classify the triangle as right or non-right triangle

Sample run:

Provide three side lengths – 0 0 0 to terminate.

3

5

4

3 5 4   Triangle possible:  Scalene and Right.


Convert the Deal Opening Hand program from Chapter 5 to incorporate functions to perform the two core tasks of 1) creating a card, and 2) determining the winner. The solution to Chapter 5 (Version 2 – Looping version) is attached, and you should use it as a baseline. You will need to take the functionality that is used to create a card and incorporate it into a function (create_card) that generates a card (suit, face, value) and returns these values to the calling/main program, that will then use these “card values” to 1) Print the card as in previous versions, and 2) use the value of each card as part of the calculation for the total hand value for each of the hands (total value for player hand and total value for dealer's hand) that is then passed to a function (highest_hand). The highest_hand function will then determine who has the highest hand and return who this is to the calling function, which will then print who has the highest hand, as in previous versions. 


Submarine

Given two numbers

totalTorpedos, torpedosFired as inputs, write a super class Submarine with property and methods as below,PropertyDescriptionisSubmergedIt should contain a boolean value to indicate whether the submarine is submerged or not.....

The sequence of operations is,

  1. Submerge the Submarine
  2. Fire torpedos
  3. Surface the Submarine

Input

  • The first line of input contains a number totalTorpedos
  • The second line of input contains a number torpedosFired

Output

  • The first line of output is a string with Submarine Submerged text
  • The second line of output is a string with the number of torpedos fired and left, as shown in sample outputs
  • The third line of output is a string with Submarine Surfaced text

Sample Input 1

5

2

Sample Output 1

Submarine Submerged

2 Torpedos Fired, 3 Left

Submarine Surfaced

Sample Input 2

10

2

Sample Output 2

Submarine Submerged

2 Torpedos Fired, 8 Left

Submarine Surfaced


sir plz provide the code for this program


Write a program using one-dimensional array that searches a number if it is found on the list of the given 5 input numbers and locate its exact location in the list.


Sample input/output dialogue:


Enter a list of numbers: 5 4 8 2 6

Enter a number to be searched: 2 2 found in location 4


Mr. Sharma has travel plans. He wants to know the distance travelled in kilometers [KM] to 

destination on October 15th. Initially Mr. Sharma travels a fixed distance of 40 KM from his 

house to Airport. If October 15th is a Full working day he travels 2200 KM to attend a 

Conference at Delhi, if it is a half working day he travels 350 KM to attend a Conference at 

Chennai, if it is a Holiday he travels 600 KM for a Holiday in Goa.


Create a calculator for the number by creating a class of number with overloading all operators in it.(Operators: ++,--,+,-,/,*, >>, <<).


Write a program using one-dimensional array that searches a number if it is found on the list of the given 5 input numbers and locate its exact location in the list.


Sample input/output dialogue:


Enter a list of numbers: 5 4 8 2 6

Enter a number to be searched: 2 2 found in location 4


Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring.

For example, if the given M and N are 4 and 4 respectively. If the matrix elements are

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

If the given K is 3. Rotate each ring of the matrix by 3 elements.

In the above matrix, the elements (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5) is a ring, similarly, the elements (6, 7, 11, 10) will make a ring.

Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be

13 9 5 1

14 7 11 2

15 6 10 3

16 12 8 4


Given a sentence as input, find all the unique combinations of two words and print the word combinations that are not adjacent in the original sentence in lexicographical order.


The foundation of the building would always be width + 2 stars if the width is an odd number, or 2 stars if the width is an even number


LATEST TUTORIALS
APPROVED BY CLIENTS