Click here to Skip to main content
15,434,918 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Write a program with an “Employee” class having two variables one for the name of employee(String) and other for base salary (float). Create a function that calculates the total salary by adding 50% HRA to the salary and returns.Create an object of this class in main function and set the name of the employee, call the salary function and print the calculated salary returned by the function with name of the employee.

What I have tried:

I have tried . My Source code was not compiling . Please help me with this . Its Urgent. Whosoever helps me my blessing are with him .
Updated 11-Dec-20 7:59am
Patrice T 11-Dec-20 13:42pm    
Show your code and error messages.

1. This site does not provide code to order, especially for homework assignments.
2. There is no level of urgency here, everyone is treated equally.

If you want help with some code you have written, then show us the code and explain the problem. People will then try to help you.
Share this answer
Pranav Gupta 12334239584958490583 11-Dec-20 13:41pm    
Sir its nice everyone is treated equally . Someone please share the solution of my Problem . I will be very gratefull to that person .
Richard MacCutchan 11-Dec-20 13:52pm    
Yes, we would be happy to help. But first, as I said, you need to show your code and explain what the actual problem is. Remember, we cannot see your screen or guess what is in your mind.
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900