java to python
hrs = input("Enter Hours:")
h = float(hrs)
rph=float(input("Enter rate per hours:"))
if hrs>40:
print (40*rph +(h-40)*rph*1.5)
else:
print(h*rph)
java to python
hrs = input("Enter Hours:")
h = float(hrs)
rph=float(input("Enter rate per hours:"))
if hrs>40:
print (40*rph +(h-40)*rph*1.5)
else:
print(h*rph)
python to java converter
def SeatingStudents(arr):
K = arr[0]
occupied = arr[1:]
rows = int(K/2)
seats = []
x = 0
for i in range(rows):
seats.append([])
for j in range(2):
if((x+1) in occupied):
full_seat = True
else:
full_seat = False
seats[i].append(str(full_seat))
x+=1
seating = 0
for i in range(rows-1):
if((seats[i][0] == str(False)) and (seats[i][1] == str(False))):
seating+=1
if((seats[i][0] == str(False)) and (seats[i+1][0] == str(False))):
seating+=1
if((seats[i][1] == str(False)) and (seats[i + 1][1] == str(False))):
seating+=1
if((seats[rows - 1][0] == str(False)) and (seats[rows - 1][1] == str(False))):
seating+=1
return seating
print(SeatingStudents([12, 2, 6, 7, 11]))
convert python code to java
for i in range(2,len(array)):
java to python
hrs = input("Enter Hours:")
h = float(hrs)
rph=float(input("Enter rate per hours:"))
if hrs>40:
print (40*rph +(h-40)*rph*1.5)
else:
print(h*rph)
python to java converter
def SeatingStudents(arr):
K = arr[0]
occupied = arr[1:]
rows = int(K/2)
seats = []
x = 0
for i in range(rows):
seats.append([])
for j in range(2):
if((x+1) in occupied):
full_seat = True
else:
full_seat = False
seats[i].append(str(full_seat))
x+=1
seating = 0
for i in range(rows-1):
if((seats[i][0] == str(False)) and (seats[i][1] == str(False))):
seating+=1
if((seats[i][0] == str(False)) and (seats[i+1][0] == str(False))):
seating+=1
if((seats[i][1] == str(False)) and (seats[i + 1][1] == str(False))):
seating+=1
if((seats[rows - 1][0] == str(False)) and (seats[rows - 1][1] == str(False))):
seating+=1
return seating
print(SeatingStudents([12, 2, 6, 7, 11]))
convert python code to java
for i in range(2,len(array)):
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us