%% Problem 1
fprintf('Problem 1\r') 
field1= 'Name'  ; value1='Hanieh Mazloom Farsibaf'; % we need to define field and value for each part of structure.
field2= 'Major' ; value2='Physics';
field3 = 'Year' ; value3='Grad Student';
Student= struct (field1,value1,field2,value2,field3,value3)

%% Problem 2
fprintf('Problem 2\r')

Nmax=10;     % The first Nmax prime numbers.
Ncount=1;    % To count the prime numbers we need
Ntest=2;     %Our current integer to be tested
primes=zeros(Nmax,1);   %Make empty vector

while Ncount < Nmax+1
    if HW2_Solution_isprime(Ntest)==1 % I use this function to check if 
                                      % Ntest is prime.
        primes(Ncount)=Ntest; % primes is a array to store prime numbers.
        Ncount=Ncount+1;   
    end
    Ntest=Ntest+1;
end 
primes


%% Problem 3 

fprintf('Problem 3\r')
fprintf('For given A=4 and B=2\r')
MathOps=HW2_Solution_MathOps(); % Define MathOps as an object of class HW2_Solution_MathOps

%Set Properties
MathOps.A=4;
MathOps.B=2;

%Show results
fprintf('A+B is')
    MathOps.AB_Add
fprintf('A*B is')
    MathOps.AB_Multi
fprintf('A-B is')
    MathOps.AB_Sub





