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
557c04ab
Commit
557c04ab
authored
7 months ago
by
Qazi Zain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new tasks are added
parent
1ba97106
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
263 additions
and
0 deletions
+263
-0
Circle.java
src/JavaTrainingTask/Question10/Circle.java
+69
-0
main.java
src/JavaTrainingTask/Question10/main.java
+9
-0
shape.java
src/JavaTrainingTask/Question10/shape.java
+11
-0
Numbers.java
src/JavaTrainingTask/Question4/Numbers.java
+49
-0
main.java
src/JavaTrainingTask/Question4/main.java
+9
-0
Patterns.java
src/JavaTrainingTask/Question5/Patterns.java
+28
-0
main.java
src/JavaTrainingTask/Question5/main.java
+9
-0
Table.java
src/JavaTrainingTask/Question6/Table.java
+29
-0
main.java
src/JavaTrainingTask/Question6/main.java
+9
-0
IICT.java
src/JavaTrainingTask/Question7/IICT.java
+33
-0
main.java
src/JavaTrainingTask/Question7/main.java
+8
-0
No files found.
src/JavaTrainingTask/Question10/Circle.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question10
;
import
java.util.*
;
public
class
Circle
extends
shape
{
int
length
,
width
,
depth
,
volume
;
Scanner
obj
;
Circle
()
{
System
.
out
.
println
(
"Circle object is created!"
);
length
=
0
;
width
=
0
;
depth
=
0
;
volume
=
0
;
obj
=
new
Scanner
(
System
.
in
);
}
@Override
void
volumeCalculation
()
{
System
.
out
.
println
(
"Enter The length of Circle:"
);
length
=
obj
.
nextInt
();
System
.
out
.
println
(
"Enter The Width of Circle:"
);
width
=
obj
.
nextInt
();
System
.
out
.
println
(
"Enter the depth of Circle:"
);
depth
=
obj
.
nextInt
();
volume
=
length
*
width
*
depth
;
System
.
out
.
println
(
"volume of circle is:"
+
volume
);
if
(
volume
<=
10
)
{
System
.
out
.
println
(
"Extra Small 10cm"
);
}
else
if
(
volume
>
10
&&
volume
<=
25
)
{
System
.
out
.
println
(
"Small 25cm"
);
}
else
if
(
volume
>
25
&&
volume
<=
75
)
{
System
.
out
.
println
(
"Medium 75cm"
);
}
else
if
(
volume
>
75
&&
volume
<=
100
)
{
System
.
out
.
println
(
"Large 100cm"
);
}
else
if
(
volume
>
100
&&
volume
<=
250
)
{
System
.
out
.
println
(
"Extra large 250cm"
);
}
else
if
(
volume
>
250
)
{
System
.
out
.
println
(
"Extra Extra large greater then 250cm"
);
}
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question10/main.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question10
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
Circle
obj
=
new
Circle
();
obj
.
volumeCalculation
();
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question10/shape.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question10
;
abstract
public
class
shape
{
shape
()
{
System
.
out
.
println
(
"shape obj is created!"
);
}
abstract
void
volumeCalculation
();
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question4/Numbers.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question4
;
import
java.util.Scanner
;
public
class
Numbers
{
// variables.
int
no
;
Scanner
input
;
Numbers
()
// constructor.
{
System
.
out
.
println
(
"Object is created!"
);
no
=
0
;
input
=
new
Scanner
(
System
.
in
);
}
void
checkNumber
()
{
System
.
out
.
println
(
"Enter the no:"
);
no
=
input
.
nextInt
();
if
(
no
%
2
==
0
)
{
if
(
no
>
0
)
{
System
.
out
.
println
(
"Its a Positive Even no!"
);
}
else
{
System
.
out
.
println
(
"Its a negative Even no!"
);
}
}
else
{
if
(
no
>
0
)
{
System
.
out
.
println
(
"Its a positive Odd no!"
);
}
else
{
System
.
out
.
println
(
"Its a negative Odd no!"
);
}
}
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question4/main.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question4
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
Numbers
check
=
new
Numbers
();
check
.
checkNumber
();
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question5/Patterns.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question5
;
import
java.util.Scanner
;
public
class
Patterns
{
int
no
;
Scanner
input
;
Patterns
()
{
System
.
out
.
println
(
"Object is Created!"
);
no
=
0
;
input
=
new
Scanner
(
System
.
in
);
}
void
printGparamid
()
{
System
.
out
.
println
(
"Enter no :"
);
no
=
input
.
nextInt
();
for
(
int
i
=
no
;
i
>
0
;
i
--)
{
for
(
int
j
=
i
;
j
>
0
;
j
--)
{
System
.
out
.
print
(
"*"
);
}
System
.
out
.
println
(
""
);
}
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question5/main.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question5
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
Patterns
obj
=
new
Patterns
();
obj
.
printGparamid
();
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question6/Table.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question6
;
import
java.util.Scanner
;
public
class
Table
{
int
no
;
Scanner
obj
;
Table
()
{
System
.
out
.
println
(
"Object is created!"
);
no
=
0
;
obj
=
new
Scanner
(
System
.
in
);
}
void
calculateTable
()
{
System
.
out
.
println
(
"Enter the no of Table you Want:"
);
no
=
obj
.
nextInt
();
for
(
int
i
=
1
;
i
<
26
;
i
++)
{
System
.
out
.
println
(
no
+
" x "
+
i
+
"= "
+
no
*
i
);
}
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question6/main.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question6
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
Table
obj
=
new
Table
();
obj
.
calculateTable
();
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question7/IICT.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question7
;
import
java.util.*
;
public
class
IICT
{
int
no
,
pow
;
Scanner
obj
;
IICT
()
{
System
.
out
.
println
(
"The object is created"
);
no
=
0
;
pow
=
0
;
obj
=
new
Scanner
(
System
.
in
);
}
void
powerCalculation
()
{
System
.
out
.
println
(
"Enter the no you want to calculate the power:"
);
no
=
obj
.
nextInt
();
System
.
out
.
println
(
"Enter the no of power you want to calculate the no:"
);
pow
=
obj
.
nextInt
();
int
temp
=
1
;
while
(
pow
>
0
)
{
temp
*=
no
;
// for power calculation.
pow
--;
}
System
.
out
.
println
(
"power that calculated is :"
+
temp
);
}
}
This diff is collapsed.
Click to expand it.
src/JavaTrainingTask/Question7/main.java
0 → 100644
View file @
557c04ab
package
JavaTrainingTask
.
Question7
;
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
IICT
obj
=
new
IICT
();
obj
.
powerCalculation
();
}
}
This diff is collapsed.
Click to expand it.
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