Question
public class Csc20Student extends CsusStudent{ private boolean preComputeMajor; private int numberOfComputerClassUnits ; public Csc20Student(String name, int id, String address, String phone, String email,boolean preCsMajor, int
public class Csc20Student extends CsusStudent{
private boolean preComputeMajor;
private int numberOfComputerClassUnits ;
public Csc20Student(String name, int id, String address, String phone, String email,boolean preCsMajor, int csUnits)
{
super();
}
public boolean getPreComputerMajor() {
}
public void setPreComputerMajor (boolean value) {
}
public int getNumberofCsUnits() {
}
public void setNumberofCsUnits (int units) {
}
public String toString () {
}
}
-----------------------------------------------------------------------------------------
public class CsusStudent {
private String studentName;
private int studentId;
private String studentAddress;
private String studentPhone;
private String studentEmail;
public CsusStudent(String newName, int newId, String newAddress, String newPhone_number, String newEmail) {
}
public void setName(String newName) {
}
public String getName() {
}
public void setID(String newID) {
}
public String getID() {
}
public void setAddress(String newAddress)
{
}
public String getAddress() {
}
public void setPhone(String newPhone_number) {
}
public String getPhone(){
}
public void setEmail(String newEmail){
}
public String getEmail() {
}
public String toString () {
}
}
------------------------------------------------------------------------------------
import org.junit.Assert;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class CsusStudentTest {
CsusStudent instance;
Csc20student instance2;
public void setUp() {
instance = new CsusStudent("John Doe", 123, "123 Somewhere", "415-555-1212", "johndoe@somewhere.com");
instance2 = new Csc20Student("John Doe", 123, "123 Somewhere", "415-555-1212", "johndoe@somewhere.com",true,15);
instance = instance2;
}
public void testGetName() {
String expResult = "John Doe";
String result = instance.getName();
assertEquals(expResult, result);
}
public void testgetAddress() {
String expResult = "123 Somewhere";
String result = instance.getAddress();
assertEquals(expResult, result);
}
public void testgetPhone() {
String expResult= "415-555-1212";
String result = instance.getPhone();
assertEqual(expResult, result);
}
public void testgetEmail() {
String expResult="johndoe@somewhere.com";
String result = instance.getEmail();
assertEquals(expResult, result);
}
}
------------------------------------------------------------------------
public class Lab5Tester {
public static void main(String[] args) {
CsusStudent student = new CsusStudent("John Doe", 123, "123
Somewhere", "415-555-1212", "johndoe@somewhere.com");
Csc20Student csc20Student = new Csc20Student("John Doe", 123, "123
Somewhere", "415-555-1212", "johndoe@somewhere.com",true,15);
System.out.println(student + " ");
System.out.println(csc20Student + " ");
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started