Question
Hi can someone trasnlate this to Java language that can be used in Net Beans class Professional(): def __init__(self, name, ptype): self.name = name.title() self.ptype
Hi can someone trasnlate this to Java language that can be used in Net Beans
class Professional(): def __init__(self, name, ptype): self.name = name.title() self.ptype = ptype if ptype.lower() == "lawyer": self.salary = 0.1 elif ptype.lower() == "personal assistant": self.salary = 0.03 elif ptype.lower() == "agent": self.salary = 0.07 elif ptype.lower() == "trainer": self.salary = 0.05 else: self.salary = 0.0 if __name__ == "__main__": professionals_hired = list() athlete_salary = float(input("Your Salary? ")) n = int(input("Number of professionals? ")) for i in range(n): professional_name = input("Please enter name of professional ") professional_type = input("Please enter type of professional ") professionals_hired.append(Professional(professional_name, professional_type)) total_salary_paid = 0 for i in professionals_hired: prof_sal = i.salary * athlete_salary print("Salary to", i.name, "=", prof_sal) total_salary_paid += prof_sal print("Total Salary Paid = ", total_salary_paid) print("Left with Athlete = ", athlete_salary - total_salary_paid)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started