Welcome! Log In Create A New Profile

Advanced

Assignment 2 Question 3

Posted by Vijen 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2 Question 3
March 11, 2010 08:45PM
I am a little confused with the requirements for Question 3 in Assignment 2:
Am I following the correct structure below?
Language: Java
import java.util.Scanner;   class Circle { static final double P = Math.PI;   static void setRadius(double fRadius) { //Code in here? }   static void getRadius(double gRadius) { //Code in here?   }   static void computeDiameter(double gRadius) { //Code in here? }   static void computeArea(double gRadius) { //Code in here?   } }   public class testCircle { public static void main(String[] args) { //code in here to call the Circle class with associated methods?     } }

Or should i create Circle class with the 4 methods and then the main method? What is meant by a test class to test the Circle class? Do we need a user input?
Re: Assignment 2 Question 3
March 12, 2010 09:58AM
The test class contains the main() function which calls the methods in the Circle class. Your test class should be separate from Circle class. There is also no need for user input.
Sorry, only registered users may post in this forum.

Click here to login