Student Mark Analysis Database Information System Insert Data into Data Field in PL SQL programming

These algorithm it will insert the data into data filed Example data 8 is insert into data field roll no.
Source code in PL SQL programming insert data into data field
SQL> declare
2 ROLLNO NUMBER(5);
3 REG_NO NUMBER(10);
4 NAME VARCHAR2(20);
5 BRANCH CHAR(3);
6 YEAR NUMBER(1);
7 SMESTER NUMBER(1);
8 MARK1 NUMBER(3);
9 MARK2 NUMBER(3);
10 MARK3 NUMBER(3);
11 MARK4 NUMBER(3);
12 MARK5 NUMBER(3);
13 MARK6 NUMBER(3);
14 AGE NUMBER(2);
15 SEX CHAR(1);
16 ADDRESS VARCHAR2(20);
17 FATHER VARCHAR2(20);
18 result varchar2(20);
19 percentage number(6,2);
20 arrears number(1);
21 begin
22 arrears:=0;
23 rollno:=&rollno;
24 reg_no:=&reg_no;
25 name:='&name';
26 branch:='&branch';
27 mark1:=&mark1;
28 mark2:=&mark2;
29 mark3:=&mark3;
30 mark4:=&mark4;
31 mark5:=&mark5;
32 mark6:=&mark6;
33 if(mark1<50) then
34 arrears:=arrears+1;
35 end if;
36 if(mark2<50) then
37 arrears:=arrears+1;
38 end if;
39 if(mark3<50) then
40 arrears:=arrears+1;
41 end if;
42 if(mark4<50) then
43 arrears:=arrears+1;
44 end if;
45 if(mark5<50) then
46 arrears:=arrears+1;
47 end if;
48 if(mark6<50) then
49 arrears:=arrears+1;
50 end if;
51 percentage:=(mark1+mark2+mark3+mark4+mark5+mark6);
52 percentage:=percentage/6;
53 if(percentage>75) then
54 result:='distinction';
55 elsif(percentage>60) then
56 result:='1st class';
57 elsif(percentage>50) then
58 result:='2nd class';
59 end if;
60 if(arrears!=0) then
61 result:='fail';
62 end if;
63 insert into per_rec values(rollno,name,&age,'&sex','&address','&father');
64 insert into col_rec values(rollno,reg_no,name,branch,&YEAR,&SMESTER);
65 insert into marklist values(reg_no,mark1,mark2,mark3,mark4,mark5,mark6);
66 insert into mresult values(reg_no,percentage,result,arrears);
67 end;
68 /
PL/SQL procedure successfully completed.
SQL> /
Enter value for rollno: 8
old 23: rollno:=&rollno;
new 23: rollno:=8;
Enter value for reg_no: 32042380
old 24: reg_no:=&reg_no;
new 24: reg_no:=32042380;
Enter value for name: RAVI
old 25: name:='&name';
new 25: name:='RAVI';
Enter value for branch: IT
old 26: branch:='&branch';
new 26: branch:='IT';
Enter value for mark1: 60
old 27: mark1:=&mark1;
new 27: mark1:=60;
Enter value for mark2: 60
old 28: mark2:=&mark2;
new 28: mark2:=60;
Enter value for mark3: 60
old 29: mark3:=&mark3;
new 29: mark3:=60;
Enter value for mark4: 60
old 30: mark4:=&mark4;
new 30: mark4:=60;
Enter value for mark5: 60
old 31: mark5:=&mark5;
new 31: mark5:=60;
Enter value for mark6: 60
old 32: mark6:=&mark6;
new 32: mark6:=60;
Enter value for age: 20
Enter value for sex: M
Enter value for address: 12 NADAN ST
Enter value for father: GIRI
old 64: insert into per_rec values(rollno,name,&age,'&sex','&address','&father');
new 64: insert into per_rec values(rollno,name,20,'M','12 NADAN ST','GIRI');
Enter value for year: 3
Enter value for smester: 5
old 65: insert into col_rec1 values(rollno,reg_no,name,branch,&YEAR,&SMESTER);
new 65: insert into col_rec1 values(rollno,reg_no,name,branch,3,5);
PL/SQL procedure successfully completed.
Student Mark Analysis Database Information system data insert into data field successfully.
Read More>>>

Student Mark Analysis Database Information System Trigger

Trigger is normally used to perform the fire the operation. If one table is change it is automatically affect another table. It is called trigger.
Source Code PL SQL Programming Student Mark Analysis Database Trigger
SQL> create or replace trigger che_tri before insert on mark list for each row
2 declare
3 m1 number(3);
4 m2 number(3);
5 m3 number(3);
6 m4 number(3);
7 m5 number(3);
8 m6 number(3);
9 begin
10 m1:=:new.mark1;
11 m2:=:new.mark2;
12 m3:=:new.mark3;
13 m4:=:new.mark4;
14 m5:=:new.mark5;
15 m6:=:new.mark6;
16 if m1<0 or m1>100 then
17 raise_application_error(-20011,'error in input');
18 end if;
19 if m2<0 or m2>100 then
20 raise_application_error(-20012,'error in input');
21 end if;
22 if m3<0 or m3>100 then
23 raise_application_error(-20013,'error in input');
24 end if;
25 if m4<0 or m4>100 then
26 raise_application_error(-20014,'error in input');
27 end if;
28 if m5<0 or m5>100 then
29 raise_application_error(-20015,'error in input');
30 end if;
31 if m6<0 or m6>100 then
32 raise_application_error(-20016,'error in input');
33 end if;
34 end;
35 /
Trigger created.
Source Code PL SQL Programming Student Mark Analysis Database Trigger created successfully
Read More>>>

Student Mark Analysis Database Information system Table creation

Create table per_rec, with attributes roll no, name ,age , sex, address, father name for student record, and create table mark list with reg no, mark1, mark2, mark3 up to mark6. Then create table col_recl.
Create Table Pl/Sql quries.
SQL> create table per_rec(rollno number(5) primary key,name varchar2(20),age number(2),sex char(1), address varchar2(20),father varchar2(20));
Table created.
SQL> create table marklist(reg_no number(10),mark1 number(3),mark2 number(3),mark3 number(3),mark4 number(3),mark5 number(3),mark6 number(3));
Table created.
SQL> create table col_rec1(rollno number(5),reg_no number(10),name varchar2(20),branch char(3) not null,year number(1),smester number(1));
Table created
SQL> create table result(reg_no number(10),percentage number(6,2),result varchar2(20),arrears number(2));
Table created.
Table Description for Student Mark Analysis Database Information with Desc
SQL> DESC PER_REC;
Name Null? Type
----------------- --------------- ------- ----
ROLLNO NOT NULL NUMBER(5)
NAME VARCHAR2(20)
AGE NUMBER(2)
SEX CHAR(1)
ADDRESS VARCHAR2(20)
FATHER VARCHAR2(20)

SQL> DESC COL_REC;
Name Null? Type
----------------- -------------- ------------
ROLLNO NUMBER(5)
REG_NO NUMBER(10)
NAME VARCHAR2(20)
BRANCH NOT NULL CHAR(3)
YEAR NUMBER(1)
SMESTER NUMBER(1)


SQL> DESC MARKLIST;
Name Null? Type
----------- -------- -----------------
REG_NO NUMBER(10)
MARK1 NUMBER(3)
MARK2 NUMBER(3)
MARK3 NUMBER(3)
MARK4 NUMBER(3)
MARK5 NUMBER(3)
MARK6 NUMBER(3)

SQL> DESC RESULT;
Name Null? Type
------------------- ------------ ------------
REG_NO NUMBER(10)
PERCENTAGE NUMBER(6,2)
RESULT VARCHAR2(20)
ARREARS NUMBER(2)
Source Code PL SQL Programming Student Mark Analysis Database Trigger Table crated successfully.
Read More>>>

Multiple Document Interface Source code Windows SDK / Visual C++ Programming

Source code visual programming step by step Algorithm
VIEW.H
// john52View.h : interface of the Cjohn52View class
#if !defined(AFX_john52VIEW_H__5A302433_602C_4F64_9D17_FBA7D351BC28__INCLUDED_)
#define AFX_john52VIEW_H__5A302433_602C_4F64_9D17_FBA7D351BC28__INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class Cjohn52View : public CView
{

protected: // create from serialization only
Cjohn52View();
DECLARE_DYNCREATE(Cjohn52View)
// Attributes
public:
Cjohn52Doc* GetDocument();
private:
int m_ncolor;
CRect m_RectEllipse;

// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(Cjohn52View)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~Cjohn52View();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions

protected:
//{{AFX_MSG(Cjohn52View)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in john52View.cpp
inline Cjohn52Doc* Cjohn52View::GetDocument()
{ return (Cjohn52Doc*)m_pDocument; }
#endif

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_john52VIEW_H__5A302433_602C_4F64_9D17_FBA7D351BC28__INCLUDED_)


VIEW.CPP

// john52View.cpp : implementation of the Cjohn52View class
#include "stdafx.h"
#include "john52.h"
#include "john52Doc.h"
#include "john52View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// Cjohn52View
IMPLEMENT_DYNCREATE(Cjohn52View, CView)
BEGIN_MESSAGE_MAP(Cjohn52View, CView)
//{{AFX_MSG_MAP(Cjohn52View)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)


END_MESSAGE_MAP()
// Cjohn52View construction/destruction

Cjohn52View::Cjohn52View():m_RectEllipse(100,100,200,300)
{

m_ncolor=BLACK_BRUSH;
}

Cjohn52View::~Cjohn52View()
{
}
BOOL Cjohn52View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return CView::PreCreateWindow(cs);
}
// Cjohn52View drawing
void Cjohn52View::OnDraw(CDC* pDC)
{
Cjohn52Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(10,10,"**john**");
pDC->SelectStockObject(m_ncolor);
pDC->Ellipse(m_RectEllipse);
}

// Cjohn52View printing

BOOL Cjohn52View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}

void Cjohn52View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}

void Cjohn52View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)

{
// TODO: add cleanup after printing
}
// Cjohn52View diagnostics
#ifdef _DEBUG
void Cjohn52View::AssertValid() const
{
CView::AssertValid();
}
void Cjohn52View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
Cjohn52Doc* Cjohn52View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cjohn52Doc)));
return (Cjohn52Doc*)m_pDocument;
}
#endif //_DEBUG

// Cjohn52View message handlers
void Cjohn52View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default

CView::OnLButtonDown(nFlags, point);
UpdateData(true);
if(m_RectEllipse.PtInRect(point))
{
if(m_ncolor==BLACK_BRUSH)
{
m_ncolor=GRAY_BRUSH;
}
else
{
m_ncolor=BLACK_BRUSH;
}
InvalidateRect(m_RectEllipse);
}
UpdateData(false);
}
Multiple Document Interface Screen Shot Step By Step Algorithm Output Multiple Document Interface Source code Windows SDK / Visual C++ Programming
Read More>>>

Dialog Based Application Cs1255 Visual Programming Lab Windows SDK / Visual C++

Source Code visual Programming Algorithm Step by step procedural algorithm
// SRUTI3View.cpp : implementation of the CSRUTI3View class
#include "stdafx.h"
#include "SRUTI3.h"
#include "SRUTI3Doc.h"
#include "SRUTI3View.h"
#include "SRUTI.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// CSRUTI3View
IMPLEMENT_DYNCREATE(CSRUTI3View, CView)
BEGIN_MESSAGE_MAP(CSRUTI3View, CView)
//{{AFX_MSG_MAP(CSRUTI3View)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

// CSRUTI3View construction/destruction

CSRUTI3View::CSRUTI3View()
{ // TODO: add construction code here }
CSRUTI3View::~CSRUTI3View()
{}
BOOL CSRUTI3View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
// CSRUTI3View drawing
void CSRUTI3View::OnDraw(CDC* pDC)
{
CSRUTI3Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/
// CSRUTI3View diagnostics
#ifdef _DEBUG
void CSRUTI3View::AssertValid() const
{
CView::AssertValid();
}
void CSRUTI3View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSRUTI3Doc* CSRUTI3View::GetDocument() // non-debug version is inline
{ ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSRUTI3Doc)));
return (CSRUTI3Doc*)m_pDocument;
}
#endif //_DEBUG
// CSRUTI3View message handlers
void CSRUTI3View::OnLButtonDown(UINT nFlags, CPoint point)
{
CView::OnLButtonDown(nFlags, point);
SRUTI c;
c.DoModal();

}
// SRUTI.cpp : implementation file
#include "stdafx.h"
#include "SRUTI3.h"
#include "SRUTI.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// SRUTI dialog
SRUTI::SRUTI(CWnd* pParent /*=NULL*/)
: CDialog(SRUTI::IDD, pParent)
{ //{{AFX_DATA_INIT(SRUTI)
m_name = _T("");
m_pname = _T("");
m_income = 0;
m_perc = 0;
//}}AFX_DATA_INIT
}
void SRUTI::DoDataExchange(CDataExchange* pDX)
{ CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SRUTI)
DDX_Text(pDX, IDC_EDIT1, m_name);
DDX_Text(pDX, IDC_EDIT2, m_pname);
DDX_Text(pDX, IDC_EDIT3, m_income);
DDX_Text(pDX, IDC_EDIT4, m_perc);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SRUTI, CDialog)
//{{AFX_MSG_MAP(SRUTI)
ON_BN_CLICKED(IDC_BUTTON1, Onsubmit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// SRUTI message handlers
void SRUTI::Onsubmit()
{ UpdateData(true);
if((m_name,m_pname,m_income,m_perc)!=0)
{
MessageBox(“Please enter an integer”);
}
{ if((m_income>40000)&&(m_perc>75))
{ MessageBox("Eligible Candidate");
}
else
{ MessageBox("Not eligible candidate");
}
}
UpdateData(false);
}

Dialog Based Application Source CS1255 VISUAL PROGRAMMING LAB Output Screen shotDialog Based Application Source CS1255 VISUAL PROGRAMMING LAB Output Screen shot
Read More>>>

Rectangle Program with Filling Source code Windows SDK / Visual C++

Source Code in Visual Programming Step by step procedural algorithm Rectangle Program with Filling
#include<windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,PSTR szCmdLine,int iCmdShow)
{
static TCHAR szAppname[]=TEXT("Rectangle and Round rectangle--*john*");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppname;
if(!RegisterClass(&wndclass))
{
MessageBox(NULL,TEXT("This programreq.windows nt"),
szAppname,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppname,TEXT("Rectangle and Round Rectangle--- *john *"),
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;



}
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
static int x,y;
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch(msg)
{
case WM_SIZE:
x=LOWORD(lParam);
y=HIWORD(lParam);
return 0;

case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
Rectangle(hdc,x/6,y/6,5*x/6,5*y/6);
SelectObject(hdc,GetStockObject(GRAY_BRUSH));
RoundRect(hdc,x/4,y/4,3*x/4,3*y/4,x/4,y/4);
EndPaint(hwnd,&ps);
return 0;

case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,msg,wParam,lParam);
}
return 0;
}

Rectangle Program with Filling Output Screen shot CS1255 VISUAL PROGRAMMING LABRectangle Program with Filling Output Screen shot VISUAL PROGRAMMING LAB
Read More>>>

How to Writing Source code for keyboard and mouse events Windows SDK / Visual C++

Writing Source code in Visual Programming to perform the Keyboard and Mouse event in windows SDK Visual C++ Compiler CS1255.There windows.h is header file winMain function it has following varaiable hinstance,hpreinstance,PSTRszCmdLine,iCmdshow
Source Code Algorithm Visual Program
#include<windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,PSTR szCmdLine,int iCmdShow)
{
static TCHAR szAppname[]=TEXT("Keyboard and Mouse events--*SENTHIL*");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppname;
if(!RegisterClass(&wndclass))
{
MessageBox(NULL,TEXT("This programreq.windows nt"),
szAppname,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppname,TEXT("Keyboard and mouse events---*SENTHIL*"),
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
MessageBox(GetFocus(),"You have pressed left mouse button","MouseEvent-*SENTHIL *",
MB_OK|MB_ICONINFORMATION);
break;
case WM_RBUTTONDOWN:
MessageBox(GetFocus(),"You have pressed right mouse button","MouseEvent-*SENTHIL *",
MB_OK|MB_ICONINFORMATION);
break;
case WM_KEYDOWN:
MessageBox(GetFocus(),"You have pressed keyboard button","Keyboard-*SENTHIL*",
MB_OK|MB_ICONINFORMATION);
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case
WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,msg,wParam,lParam);
}
return 0;
}
Keyboard and Mouse Events Output CS1255 Screen Shot
Right mouse click event Screen shot step by step procedure algorithm
Click Keyboard Button Screen shot step by step procedure algorithm
Left mouse click event Screen shot step by step procedure algorithm
Right mouse click event Screen shot step by step procedure algorithmClick Keyboard Button Screen shot step by step procedure algorithm
Right mouse click event Screen shot step by step procedure algorithm
Read More>>>