You are on page 1of 11

COMPUTER APPLICATION IN

ENGINEERING DESIGN

LAB REPORT # Lab Mid

SUBMITTED TO: ENGR. AYESHA BATOOL

SUBMITTED BY: Muhammad Shoaib Talib

DE-40
SYNDICATE - A
DATE: 21/06/2020

Rubrics Obtained Marks Total Marks

R1 Formatting 4

R2 Task Completeness 2

R3 Task Correctness 2

R4 Plagiarism 1

R5 In Time submission 1

3 TOTAL MARKS
∑ 𝑅 ∗ 𝑅4 ∗ 𝑅5
1
/ 10

DEPARTMENT OF COMPUTER AND SOFTWARE ENGINEERING


TASK #:

CODE:
function varargout = ATMMA(varargin)
% ATMMA MATLAB code for ATMMA.fig
% ATMMA, by itself, creates a new ATMMA or raises the existing
% singleton*.
%
% H = ATMMA returns the handle to a new ATMMA or the handle to
% the existing singleton*.
%
% ATMMA('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ATMMA.M with the given input arguments.
%
% ATMMA('Property','Value',...) creates a new ATMMA or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before ATMMA_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to ATMMA_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help ATMMA

% Last Modified by GUIDE v2.5 21-Jun-2020 14:10:25

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ATMMA_OpeningFcn, ...
'gui_OutputFcn', @ATMMA_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before ATMMA is made visible.


function ATMMA_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to ATMMA (see VARARGIN)
% Choose default command line output for ATMMA
handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes ATMMA wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = ATMMA_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

function pass_Callback(hObject, eventdata, handles)


% hObject handle to pass (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of pass as text


% str2double(get(hObject,'String')) returns contents of pass as a
double

% --- Executes during object creation, after setting all properties.


function pass_CreateFcn(hObject, eventdata, handles)
% hObject handle to pass (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function with_Callback(hObject, eventdata, handles)


% hObject handle to with (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of with as text


% str2double(get(hObject,'String')) returns contents of with as a
double
% --- Executes during object creation, after setting all properties.
function with_CreateFcn(hObject, eventdata, handles)
% hObject handle to with (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function depo_Callback(hObject, eventdata, handles)


% hObject handle to depo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of depo as text


% str2double(get(hObject,'String')) returns contents of depo as a
double

% --- Executes during object creation, after setting all properties.


function depo_CreateFcn(hObject, eventdata, handles)
% hObject handle to depo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function check_Callback(hObject, eventdata, handles)


% hObject handle to check (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of check as text


% str2double(get(hObject,'String')) returns contents of check as a
double

% --- Executes during object creation, after setting all properties.


function check_CreateFcn(hObject, eventdata, handles)
% hObject handle to check (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in Passok.


function Passok_Callback(hObject, eventdata, handles)
% hObject handle to Passok (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global money;
money=400;
set(handles.withok,'Enable','off')
set(handles.depook,'Enable','off')
set(handles.checkok,'Enable','off')
password=get(handles.pass,'String');
password=str2num(password);
if(password==12345)
set(handles.withok,'Enable','on')
set(handles.depook,'Enable','on')
set(handles.checkok,'Enable','on')
else
set(handles.pass,'String','Invalid Password');
end

% --- Executes on button press in depook.


function depook_Callback(hObject, eventdata, handles)
% hObject handle to depook (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Accessing the Global variable Money
global money;
%Accessing the deposit Money
mon=get(handles.depo,'String');
mon=str2num(mon);
%Adding the Depocit Money
money=money+mon;

de='Deposited Rs- ';


de1=num2str(mon);
c=strcat(de,de1);
%Display Deposit Money Message
set(handles.depo,'String',c);

% --- Executes on button press in checkok.


function checkok_Callback(hObject, eventdata, handles)
% hObject handle to checkok (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Accessing the Current Amount
global money;
%Converting to String
mon=num2str(money);
%if Balance is less than 100
if(money<100)
%Display insufficient Balance
set(handles.check,'String','Balance < 100');
else
%Set the Current Balance
set(handles.check,'String',mon);
end

% --- Executes on button press in withok.


function withok_Callback(hObject, eventdata, handles)
% hObject handle to withok (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Accessing the global variable Money
global money;
%Getting the withDraw Amount
mon=get(handles.with,'String');
%Converting it to num
mon=str2num(mon);
%Check if Amount of withDraw is greater than the balance
if(mon>money)
%Displaying Money Exceed
set(handles.with,'String','Money Range Exceed!');
else
%If less than withdraw!
money=money-mon;
end

OUTPUT:

You might also like