Assignment No. 01
Semester: Fall 2016
Web Design and Development -CS506
Total Marks: 20
Due Date: November 21,
Please read the following instructions carefully before submitting assignment:
You should submit your assignment before or on due date on VULMS.
Your assignment should be your own work. It should not be copied from internet,
handouts or books.
You are suggested to use Netbeans IDE for developing your assignment.
You should import java swing and math packages in your classes.
You should create project with your Roll No. in Netbean IDE and create required
You should zip your complete project (along with .java,.class and .jar files etc.) and
upload on VULMS as a single file.
Your zipped file should be in .zip or .rar file format only. Any compressed format
other than .zip or .rar of your programs will be considered the incorrect files and
rewarded by zero.
Assignment sent via Email will not be replied and accepted in any case.
If the submitted assignment does not open or file is corrupt, it will not be marked and
awarded Zero marks.
To build understanding towards building classes along with its related methods
To know how to write default and parameterized constructors
To write user-defined methods in classes and invoke them
To take user input using Graphical User Interface (GUI)
For any query about the assignment, contact at CS506@vu.edu.pk
Question: Marks 20
Write a java program to prompt the user to take the input in a double variable for the radius of a
sphere, and call method sphereVolume() to calculate the volume of the sphere.
Use the following statement to calculate the sphere volume:
Double volume = (4.0 /3.0) * Math.PI * Math.pow(radius, 3)
You should define two public classes Sphere and SphereTest. The Sphere class will contain the
calculation procedure of sphere along with data members and getter / seyter methods. SphereTest
class will contain the main method and use the object of first class to call its method.
Your program should have a separate print() method for displaying the volume of the sphere.
You should ensure that input value for radius should not be negative nor 0. In such cases, re-prompt
user to input again.
You should parse the input into related primitive data type using Wrapper classes, if required.
You should pass the user input to parameterized constructor.
You should write a default constructor that would set the value for radius to 1.0 for Sphere class.
BEST OF LUCK
window 10 mn kuch bi nhi ho rha kia kron ....
Complete Final CS506 Assignment Solution.. The assignment solved in step by step coding and with full explanation in Video. You will not only solve the assignment but also you will get more understanding.
bro mjhe ap se help chahye kia ap apna num inbox kr skty hain mane assignment bna li hui hai mjhe kuch problem aa rai hai.
Ap Video kae neechy comment kerdo ya FB link per description main related post per question ker sakty ho
Message me at VU Solver and ask question i will help u bro
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
yA q aa raha ha can u help me plz