Given a string of numbers S, the task is to find the maximum value from the string S, you can add a ‘+’ or ‘*’ sign between any two numbers.
For example, S=891. As 8*9*1 = 72 and 8*9+1 = 73. So, 73 is maximum.
Write a python module MaxValue.py for solve the above task. You need to import this module in your file which takes a string and return maximum value or error message as shown in example by calling the appropriate function implemented in MaxValue.py module. Also handle the possible exceptions and display the exception message in form of string.
Example-1
Input:
01231
Output:
10
example 2
Input:
891
Output:
73
example 3
Input:
0000
Output:
example 4
Input:
45f
Output:
Invalid Number
Write a program to print the area and parimeter of a triangle having side of 3,4 and 5 unit by creating a class named 'triangle' with the constructor having the three sides as it's parameters.
create a program that will ask the user to give a number for the divided and the divisor and then program will compute and display the quotient and its remainder on the screen
// quotient.cpp
// Author: Mr jake R. pomperada, BSCS, MAED- IT
// Date: august 14, 2018 Tuesday
// Location: Bacolod City, Negros occidental
// Website: http://www.jakerpompereda.com
create a program that will ask the user to give a number for the divided and the divisor and then program will compute and display the quotient and its remainder on the screen
// quotient.cpp
// Author: Mr jake R. pomperada, BSCS, MAED- IT
// Date: august 14, 2018 Tuesday
// Location: Bacolod City, Negros occidental
// Website: http://www.jakerpompereda.com
Replacing Array Item
input
output
input1
[1,2,3,"four",5,6]
"four"
4
output1
[1,2,3,4,5,6]
input2
[22,44,88,352,352]
352
176
output2
[22,44,88,176,352]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
////
/////
function main() {
let myArray = JSON.parse(readLine().replace(/'/g, '"'));
let targetItem = JSON.parse(readLine().replace(/'/g, '"'));
let replaceItem = JSON.parse(readLine().replace(/'/g, '"'));
Write your code here and log the output
}
// quotient.cpp
// Author: Mr jake R. pomperada, BSCS, MAED- IT
// Date: august 14, 2018 Tuesday
// Location: Bacolod City, Negros occidental
// Website: http://www.jakerpompereda.com
Date format 2
Input
200
Output
3 minutes 20 seconds
Question 7
X = np.array([
[10,20,30],
[40,50,60],
[70,80,90]])
Answer:
print(X)
array([20, 50, 50])
Question 8
Y = np.array([
[3,6,9,12],
[15,18,21,24],
[27,30,33,36],
[39,42,45,48],
[51,54,57,60]])
Answer:
Question 8 Output
array([[ 3, 12],
[27, 36],
[51, 60]])
Question 9
print("Original array:")
Answer:
print(x)
>>>array([ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
print(“Remove even numbers from the array x: “)
Answer:
print(x)
>>>array([12, 14, 16, 18, 200])
print(“Replace all odd numbers in array x with -10:”)
Answer:
print(x)
>>> array([ 12, -10, 14, -10, 16, -10, 18, -10, 20])
Question 10
print("Original array:")
Answer:
>>> print(X)
[10 12 14 16 18 20 22 24 26 28 30]
>>> print(Z)
[10 12 14 16 18 20 22 24 26 28 30]
Answer:
>>> print(X)
[0 2 4 6 18 20 22 24 26 28 30]
Answer:
>>> print(Z)
[10,12,14,16,-18,-20,-22,-24,26,28,30]
Question 4
Answer:
Question 4 Output
array([8 10 12 14 16 18 20])
Question 5
print("Original array:")
Answer:
print(x)
>>>[12 13 14 15 16 17 18 19]
print("Reverse array:")
Answer:
>>>array([19, 18, 17, 16, 15, 14, 13, 12])
Question 6
x = [11, 12, 13]
print("Original array:")
print(x)
Answer:
print("After append values to the end of the array:")
print(x)
Question 6 Output
Original array:
[11,12,13]
After append values to the end of the array:
[21 22 23 24 31 32 33 34]