TS:ADV JAVA : SKILL:2
Submitted by : [Link] naganka sri prabhu surya sai.
ID:2000031385
SEC : 4 B
DATE : 06-08-21.
Problem: HELPING A CONFUSED STUDENT (Constructor chaining… Numbers)Ravi who is lazy
to do his homework given by his math teacher,always finds a way to escape his
[Link] many escapes he finally caught to his principal who is ready to give him a
[Link] test his knowledge in mathematics the principal randomly giving numbers for
addition (2,3,4) numbers they might be a combination of decimals and numbers -If 4 numbers are
given return the sum of first two and first three and four number’s sum-if 3 numbers are given
return sum of first two and three numbers sum-if two numbers are given return return sum of
two numbersAnd he asked to answer [Link] give him confidence the principal will let
raviknow how many numbers are going to be there that has to be [Link] constructor
overloading and constructor chaining concept in java and help him by developing java code
effectively to solve his problemNOTE- use switch case INPUT:X-Case of many numbers to be
addeddecimals and numbers accordingly OUTPUT:Addition of 1sttwo,three and four given
numbers.
Screen shots:
OUTPUT: