/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Problem3_1 {

	// complete this class, called Problem3_1, with the following items:

	// 1. Declare four attributes, name, age, height, and weight of types String
	// and int-s.
	// Write a constructor for this class that initializes ONLY the name, age,
	// and height to three incoming arguments,
	// and sets the weight to always be -1 (the latter is not an incoming
	// argument).
	String name;
	int age;
	@Override
	public String toString() {
		return "Problem3_1 [name=" + name + ", age=" + age + ", height=" + height + ", weight=" + weight + ", address="
				+ address + "]";
	}

	int height;
	int weight;

	Address address;

	public Problem3_1(String name1, int age1, int height1) {
	  name = name1;
	  age = age1;
	  height = height1;
	  weight = -1;
	}

	void setAddress(Address s) {
		//address = s;
		
		this.address = s;
	}

	// 2. Imagine there is a class called Address that you have access to (it's
	// below).
	// Its constructor takes an integer street number and a String street. Add
	// an attribute called address to
	// the Problem3_1 class, and create a **method called setAddress that sets
	// the attribute to the incoming argument.**

	public static class Address {

		int number;
		String street;

		public Address(int n, String s) {
			number = n;
			street = s;
		}

		@Override
		public String toString() {
			return "Address [number=" + number + ", street=" + street + "]";
		}

	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		/*Problem3_1 ppp = new Problem3_1("name1",20,5);
		Problem3_1.Address a_address= new Problem3_1.Address(20,"1st street");
		a.setAddress(a_address);
		
		System.out.println(a.address);*/
		
		int failed = 0; 

	    Problem3_1 p = new Problem3_1("Jane", 22, 65); 

	    if (p.name.compareTo("Jane") == 0 && p.age == 22 && p.height == 65 && p.weight == -1) 
	        System.out.println("Test 1 passed!"); 
	    else{ 
	        failed ++; 
	        System.out.println("Please check your code for question 1! "); 
	    } 

	    Address a = new Address(12, "Fairfax Dr"); 
	    p.setAddress(a); 

	    if (p.address == a) 
	        System.out.println("Test 2 passed!"); 
	    else{ 
	        failed ++; 
	        System.out.println("Please check your code for question 2! "); 
	    }         


	    if (failed > 0) 
	        System.out.println("Failed"); 
	    else{ 
	        System.out.println("GREAT WORK! EVERYTHING PASSED!"); 
	        System.out.println("Nice"); 
	    } 
	}

}