Gradle - Fabricating Systems Hands-on Solutions | TCS Fresco Play
Gradle - Fabricating Systems Hands-on Solutions
Disclaimer: The primary purpose of providing this solution is to assist and support anyone who are unable to complete these courses due to a technical issue or a lack of expertise. This website's information or data are solely for the purpose of knowledge and education.
Make an effort to understand these solutions and apply them to your Hands-On difficulties. (It is not advisable that copy and paste these solutions).
All Question of the MCQs Present Below for Ease Use Ctrl + F with the question name to find the Question. All the Best!
Course Path: Mobility & Wearables/BUILD TOOLS/Gradle - Fabricating Systems
1.Try it out - Fibonacci Sequence
Welcome to Gradle program to generate Fibonacii series
File Name - build.gradle
def fib(n)
{
int first_num = 1
int second_num = 1
if(n==1)
println first_num
else if(n==2)
println first_num + " "+second_num
else if (n > 2)
{
print first_num + " "+second_num
int i = 3
while(i<=n)
{
int z = first_num + second_num
print " "+z
first_num = second_num
second_num = z
i = i+1
}
}
}
task fibo(){
doLast
{
int n = Integer.parseInt(num)
println "First"+n+"fibonacci numbers:"
fib n
}
}
2.Try it out - Play with Dependencies
Welcome to Gradle program to define dependency tasks
File Name - build.gradle
project(':projectA'){
task hello
}
task hello
println tasks.getByPath('taskA').path
println tasks.getByPath('independent task').path
println tasks.getByPath('taskB').path
println tasks.getByPath('dependent on taskA').path
3.Exercise to Build Java Project
Welcome to Gradle program to calculate area of circle and square
File Name - build.gradle
task circle {
doLast {
double area = (22/7)*Double.parseDouble(radius)*Double.parseDouble(radius)
println 'area of circle is = '+area
}
}
task square {
doLast {
double area = Double.parseDouble(side)*Double.parseDouble(side)
println 'area of circle is = '+area
}
}
**************************************************Credit for the above notes, goes to the respective owners.If you have any queries, please feel free to ask on the comment section.If you want MCQs and Hands-On solutions for any courses, Please feel free to ask on the comment section too.Please share and support our page!
Post a Comment