Write a program that will read an arbitrary number of sets of triangle sides using only integer values.
You need to have functions for the following tasks:
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,
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