Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
Java. training
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qazi Zain
Java. training
Commits
8e775f1d
Commit
8e775f1d
authored
Oct 14, 2024
by
Qazi Zain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new task added
parent
557c04ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
Salary.java
src/JavaTrainingTask/Question11/Salary.java
+77
-0
main.java
src/JavaTrainingTask/Question11/main.java
+8
-0
No files found.
src/JavaTrainingTask/Question11/Salary.java
0 → 100644
View file @
8e775f1d
package
JavaTrainingTask
.
Question11
;
import
java.util.*
;
public
class
Salary
{
String
Qualification
;
String
Gender
;
int
yearsOfExperince
;
Scanner
obj
;
Salary
()
{
System
.
out
.
println
(
"Object is created!"
);
yearsOfExperince
=
0
;
Qualification
=
""
;
Gender
=
""
;
obj
=
new
Scanner
(
System
.
in
);
}
void
calculateSalary
()
{
System
.
out
.
println
(
"Enter the Qualification:"
);
Qualification
=
obj
.
nextLine
();
System
.
out
.
println
(
"Enter the Gender:"
);
Gender
=
obj
.
nextLine
();
System
.
out
.
println
(
"Enter the Qualification:"
);
yearsOfExperince
=
obj
.
nextInt
();
if
(
Gender
.
equals
(
"male"
)
&&
Qualification
.
equals
(
"MS"
)
&&
yearsOfExperince
==
5
)
{
System
.
out
.
println
(
"Salary is 90000"
);
}
else
if
(
Gender
.
equals
(
"female"
)
&&
Qualification
.
equals
(
"MS"
)
&&
yearsOfExperince
==
5
)
{
System
.
out
.
println
(
"Salary is 80000"
);
}
else
if
(
Gender
.
equals
(
"male"
)
&&
Qualification
.
equals
(
"BS"
)
&&
yearsOfExperince
>=
5
)
{
System
.
out
.
println
(
"Salary is 60000"
);
}
else
if
(
Gender
.
equals
(
"female"
)
&&
Qualification
.
equals
(
"BS"
)
&&
yearsOfExperince
>=
5
)
{
System
.
out
.
println
(
"Salary is 55000"
);
}
else
if
(
Gender
.
equals
(
"male"
)
&&
Qualification
.
equals
(
"BS"
)
&&
yearsOfExperince
<
5
)
{
System
.
out
.
println
(
"Salary is 50000"
);
}
else
if
(
Gender
.
equals
(
"female"
)
&&
Qualification
.
equals
(
"BS"
)
&&
yearsOfExperince
<
5
)
{
System
.
out
.
println
(
"Salary is 40000"
);
}
else
if
(
Gender
.
equals
(
"male"
)
&&
Qualification
.
equals
(
"BBA"
)
&&
yearsOfExperince
<
5
)
{
System
.
out
.
println
(
"Salary is 25000"
);
}
else
if
(
Gender
.
equals
(
"female"
)
&&
Qualification
.
equals
(
"BBA"
)
&&
yearsOfExperince
<
5
)
{
System
.
out
.
println
(
"Salary is 20000"
);
}
}
}
src/JavaTrainingTask/Question11/main.java
0 → 100644
View file @
8e775f1d
package
JavaTrainingTask
.
Question11
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
Salary
obj
=
new
Salary
();
obj
.
calculateSalary
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment