Professional Documents
Culture Documents
On The Job Training: "Inventory Management "
On The Job Training: "Inventory Management "
JOB TRAINING
REPORT
ON
“INVENTORY MANAGEMENT ”
SUBMITTED TO
KURUKSHETRA UNIVERSITY, KURUKSHETRA
IN PARTIAL FULLFILLMENT OF THE
REQUIREMENT
FOR THE B.COM-II
(COMPUTER APPLICATION VOCATIONAL)
SUBMITTED BY:
Mohit Sharma
B.Com II (CAV)
Roll No 22509
MOHIT
SHARMA
B.Com-II
Roll No 22509
Uni Roll No
CERTIFICATE-I
The work done in project is result of the candidate’s own effort and report
maintained is satisfied as per required.
Prof P. Mathur
Principal
Ambala Cantt
INVENTORY MANAGEMENT
In many retail and wholesale operations, the single largest asset is inventory.
Control of this investment is vital. It will eliminate a number of the problems
associated with capital shortages and will also provide capital to permit
expansion of operations for increased sales and profit.
Inventory Management
Inventory management can be briefly described as:
Acquiring an adequate supply and assortment of merchandise from
which customers can buy.
Providing safety stocks to meet unexpected demand or delays in
inventory replenishment.
Maintaining clear, correct, and current records.
Purchasing the proper assortment of goods in quantities that will
maintain inventory levels consistent with business requirements, while
providing adequate safety stocks.
Reducing excessive inventories promptly, so that the dollars realized
from clearing overstocks can be invested in merchandise with a
greater market potential.
Inventory Replenishment
The key to successful inventory management is adherence to procedures for
inventory replenishment. Your ability to anticipate customer demand for
certain items will help you plan your inventory purchases so that sufficient
stocks are on hand to accommodate sales volume without excesses that
cause other problems.
Planning your purchases will also help you avoid shortages that can only be
filled through forfeiture of discounts or absorption of premium shipping
charges.
Determining purchasing requirements involves answering two questions:
• What to buy?
• How much to buy?
Both questions can be answered by establishing an inventory target for any
item you carry expressed as so many days', weeks', or months' sales. For
example, if a grocery store planned to carry a two days' supply of muffins,
and average daily sales were 15 boxes of muffins, then a desirable inventory
level could be calculated as follows:
If the supply on hand is less than 30 boxes, then more muffins must be
purchased. If the actual stock were 17 boxes, then the grocer would have to
purchase 13 (30 - 17) boxes.
The example of the grocer is relatively simple. Purchases are made directly
from the truck.
Sales in the last few days are a reasonable indicator of sales in the next two
days. There is no waiting period for deliveries and supply is reliable. In
many businesses, the problem becomes far more complex.
In any business, an appropriate inventory level should be calculated by
considering expected sales in the coming period. For products that show a
steady sales pattern regardless of season or current fads, this can be based
upon average monthly sales.
Sales Forecasting
The first step in estimating expected sales in coming months is to calculate,
from inventory records, actual sales during an appropriate review period. For
example, if you want to determine an appropriate inventory level for ski
boots on October 1, it will be of little value to consider sales in July, August,
or September. Average monthly sales for the entire year will tell you little
or nothing either. A more suitable review period would be the months of
October, November, and December of the previous year. In addition, if your
sales showed a year-to-year growth rate, you should adjust review period
sales for the average sales growth that your business has experienced in the
previous year. Consider the following example. A sporting goods store
desires to maintain a three months' supply of ski boots in inventory. On
October 1, the store is determining a suitable inventory level so that an order
can be prepared to build inventory to the three-month level. Sales of ski
boots have increased 20% from year to year. Sales in October, November,
and December of the previous year were as follows:
October 5
November 10
December 20
Adding 20% to each of these amounts to reflect sales growth, expected sales
for the present year would be as follows:
October 6
November 12
December 24
Expected sales for the three-month period would then be 42 (6 + 12 + 24).
Therefore, the store should try to have this quantity in inventory on October
1. Another factor that should be considered in demand forecasting is whether
or not stock outs that prevented a customer request from being fulfilled
affected sales during the review period.
Forecasting requires measurement of customer demand for a particular item,
the number of pieces that customers wished to purchase, not just those
orders that you were able to sell. If information is available, such requests
should be added to actual sales for the review period in order to reach a more
realistic estimate of demand for the coming months.
What to Buy?
The desired inventory level should be considered an order point. Whenever
the stock of an item falls below this point, it should be ordered.
For example, if a camera shop wishes to maintain a 10 weeks' supply of film
in inventory and average sales of a particular film type are 50 rolls per week,
the order point would be 500 (50 x 10) rolls. When inventory drops below
500 rolls, more film should be ordered.
To determine the order quantity, you must first calculate the order ceiling:
Order Point 4 weeks
+ Order Interval 4 weeks
= Order Ceiling 8 weeks or 24 (8 x 3) saws
Assume that an order is being prepared for saws. Average weekly sales are 3
saws and the stock on hand is 10 saws. This is below the order point of 12 (4
x 3) saws. The order quantity would then be calculated as follows:
Order Ceiling 24
- Stock on Hand 10
= Order Quantity 14
The hardware store should order 14 saws. If any are already on order, the
outstanding order quantity should be subtracted.
Other Ordering Considerations
No business can be run by formulas alone. But formulas can be useful in
guiding decisions.
Before straying from them, you should be sure to have good and sufficient
reason.
One common reason for straying from the ordering formulas previously
described is the availability of quantity discounts and price specials.
Naturally, you want to take advantage of these potential savings whenever
possible. However, if quantity discounts force you to order far more than
you need, the discount you earn may later be lost when you are forced to
close out the merchandise at distress prices.
Maintaining Control
Systematic review of inventory purchases is the most effective means of
preventing overstocks and avoiding lost sales. The availability of accurate
inventory and sales records, combined with your own judgment, can guide
you to sound purchasing decisions.
Opening Inventory
+ Additions to Inventory during the period
- Deductions from Inventory during the period
= Ending Inventory
Inventory Valuation
Inventory calculations, based upon units, are useful when determining the
inventory of a particular item. More often, however, you will want to know
the dollar value of inventory, particularly your total inventory. Total
inventory can be evaluated in total dollars only since it usually includes a
mix of various items such as apples and oranges, which cannot be added
together.
Valuation at Cost
In most businesses, inventories are valued at cost. For example, an appliance
retailer purchases hair dryers for $7.50 each and sells them for $13.50 each.
The value assigned to each hair drier in inventory would be $7.50.
The exception to this rule occurs in some retailing activities, where many
retailers find it more convenient to evaluate the inventory at the retail price
since this permits easier calculation of such figures as markups, markdowns,
and expenses as a percentage of sales. When calculating the value of
inventory, consistency requires that all factors be evaluated on the same
basis. If inventory is valued at cost, purchases must be entered at cost when
determining deductions. If inventory is valued at retail, sales and receipts
must also be measured at retail.
A school supplies distributor has a beginning inventory on June 1 of
$200,000. During the month, sales are $50,000. The cost of these sales is
$35,000. New supplies are received with a cost of $40,000. You would
calculate the June 30 inventory as follows:
Beginning Inventory $200,000
+ Production 40,000
- Sales 35,000
= Ending Inventory $205,000
Note that sales are recorded at cost, not actual selling prices, to be consistent
with the wholesaler's inventory valuation basis.
Purpose
To manage your inventory successfully, you should maintain accurate and
up-to-date records of sales and stock on hand for every item that you sell.
Inventory records tell you what you have. Sales records tell you what you
need. Inventory records are used for making the following decisions:
• Purchases for inventory replenishment.
• Scrapping or clearing of obsolete items that are no longer in demand.
• Addition of new items to inventory.
System
The best type of system for your business depends largely upon the number
of different items you carry in inventory. A retail bicycle shop might carry
40 or 50 items in inventory, a bookstore might have a few hundred titles, and
a plumbing supply house might carry several thousand different items in
inventory.
Toaster:
Physical Inventory
A physical inventory should be taken periodically to be sure that the actual
quantities on hand equal those shown on the inventory records. The
inventory records must then be adjusted to reflect any difference between
"physical inventory" and "book inventory," the quantities shown on the
inventory records. The actual quantity of each item on hand must be counted
and compared with that shown on the inventory record. Necessary
adjustments should be made immediately.
Differences between book and physical inventory arise for many reasons.
The most easily understood, of course, is pilferage. Any business naturally
wants to maintain an inventory control system to detect this situation as
early as possible. Other reasons for inventory shortages are somewhat more
subtle but equally damaging, if not worse. For example, if your receiving
procedures are faulty, a receiving clerk may not be counting actual quantities
received and comparing them with those on the vendor's packing list or
invoice. If the quantity actually received is less than that invoiced to you,
you are paying for the difference!
Merchandise may be sold to customers without being billed to them, through
oversight or carelessness. In these cases, you will take a loss equal to your
cost of the product and also lose the profit that you should have earned on
the sale.
Clerks may be accepting customer returns of merchandise that are no longer
saleable because of damage, stains, or packing defects. You may be ignoring
opportunities to return merchandise to vendors when it arrives in an unfit
condition for resale.
PROBLEM IDENTIFICATION
Ratios of Sales to Inventory
Inventory quantities are often expressed in terms of an equivalent number of
days', weeks', or months' sales. For example, a retailer of automotive parts
might maintain a two-months' supply of fast-moving items. This means that
it has a sufficient quantity on hand to fill expected sales in the coming two-
month period. A produce broker, faced with problems of spoilage and high-
cost refrigerated storage space, would carry a much smaller inventory,
perhaps just a few days' supply.
Determining your inventory levels in terms of an equivalent number of
days', weeks', or months' supply permits you to do the following:
• Compare your own inventory levels with similar businesses to detect
excesses that should be corrected.
• Evaluate the inventory of individual items so that prompt action can
be taken to correct shortages or excesses.
• Establish replenishment policies so that inventories can be sustained
at realistic levels, minimizing the possibility of lost sales or excessive
investments.
ADVANTAGES
Security and audit trails provide you with the control needed to reduce costs
and improve you bottom line.
Another advantage of it is that the drop ship functionality will help you
streamline the purchasing process so the cost associated with putting
products on the shelf can be completely eliminated.
Key Features
» Serial number tracking
» Multiple stock areas (serialized items only)
» Graph inventory levels
» Item upgrades/downgrades
» Barcode printing
» Batch-fill sequential mfg. serial numbers
» Item label designer
» Manage non-serialized items
» Price protection
» Lot tracking
» Item images
» Item matrix (color, size, pattern, etc.)
» Item kits
» Audit trail for inventory adjustments
» Multi-level categories
» Stock transfer
» Item grouping/profiling
» Categorize stock areas as standard, in process, scrap or repair
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include<time.h>
#define TRUE 1
#define FALSE 0
struct calculate_bill
{
char itmcode[8];
char itmname[50];
float itmprice;
float qty;
float tot;
}bill[100];
char password[8];
int main(void)
{
float issued_qty;
char choice,code[8];
int flag,i,itmsold;
float get_investment(void);
FILE *ft;
// setdefaultmode(); /*Set 24 X 80 Text mode VDU*/
setlastsavedcfg(); /*Sets last saved color configuration*/
#ifdef ok
if(call_get_password() == 0)
{
messagebox(10,20,"!!!!INVALID PASSWORD,EXITING!!!!","INVALID",'
',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
call_end();
exit(0);
}
#endif
fp=fopen("stock.dat","rb+"); /*Opens & set 'fp' globaly,So we can access this file from
anywhere in the program*/
if(fp==NULL)
{
clrscr();
printf("\nTHE REQUIRED DATABASE FILE DOES NOT EXIST!!!\nPRESS
ENTER TO CREATE IT.OTHERWISE Press Any Key...\n ");
fflush(stdin);
if(getch()==13)
{
fp=fopen("stock.dat","wb+");
printf("\nFILE CREATED!!!\nRESTART THIS PROGRAM AGAIN!!!\nPress Any
Key...");
fflush(stdin);
getch();
exit(0);
}
else
{
/* messagebox(10,40,"ERROR IN FILE CREATION!!! ","ERROR
",'*',msgboxbgclr,msgboxfgclr);*/
exit(0);
}
}
/*Control reach here only if database file has been opened successfully*/
/*Now the database file is ready*/
if(initmouse()==0) /*Mouse initialising*/
messagebox(10,10,"MOUSE DOESNOT LOADED!!! ","ERROR ",'
',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
showmouseptr();
/*Now the mouse is ready*/
_setcursortype(_NOCURSOR);
while(1) /*Vital loop*/
{
clrscr();
modify=FALSE;
Displaymenu(); /*Display Menu & Skins that the user see*/
count=0;
rewind(fp);
while(fread(&stock,recsize,1,fp)==1) /*Calculate number of records in the file
"stock.dat"*/
++count;
textcolor(mnutxtfgclr);
textbackground(mnutxtbgclr);
gotorc(23,3);
cprintf("Tot: %d",count);
textcolor(LIGHTGRAY);
textbackground(BLACK);
fflush(stdin);
choice=getresponce(); /*Wait for a user responce,It may with mouse or keyboard*/
switch(choice)
{
case '0': /*For Exit*/
backup(); /*Take a backup of Database file for secure data*/
save_cur_cfg();
flushall();
fclose(fp);
fcloseall();
print2vdu(12,35,"Thanks ",BLACK,YELLOW,0);
sleep(1);
setdefaultmode(); /*Set 25x80 mode*/
// call_end();
exit(0);
case '2':
print2vdu(3,21,"ENTER A NAME=>",BLACK,WHITE,0);
scanf("%s",code);
if(savecfg(code)==0)
{
messagebox(10,30,"SORRY UNABLE TO SAVE GAME!!!","ERROR",'
',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
break;
}
else
{
messagebox(10,30,"CONFIGURATION SAVED
SUCCESSFULLY","SAVE",' ',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
break;
}
case '3':setcfg();break;
}
#endif
Displaymenu() /*Display Menu & Skins that the user see.All the color settings are
previousely defined*/
{
/*Next 4 lines are just for fill the sreen area colors*/
if(space1_bgclr != BLACK || space1_symb != ' ') /*Remember Defaul is Black,If so
we do'nt want to fill it*/
fillcolor(2,1,23,20,space1_symb,space1_bgclr,space1_fgclr,0);
if(space2_bgclr != BLACK || space2_symb != ' ') /*Remember Defaul is Black,If so
we do'nt want to fill it*/
fillcolor(2,21,23,79,space2_symb,space2_bgclr,space2_fgclr,0);
print2vdu(2,2,"1:ADD NEW ITEM",mnutxtbgclr,mnutxtfgclr,0); /*1 to 15 text
color,16to384 Background color,385 to...Blinking*/
print2vdu(4,2,"2:MODIFY RECORD",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(6,2,"3:DISPLAY AN ITEM",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(8,2,"4:ANALYSYS",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(10,2,"5:ISSUE ITEMS",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(12,2,"6:ITEMS TO ORDER",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(14,2,"7:DELETE AN ITEM",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(16,2,"8:SETTINGS",mnutxtbgclr,mnutxtfgclr,0);
print2vdu(18,2,"0:EXIT",mnutxtbgclr,mnutxtfgclr,0);
/*Skins
^^^^^^^*/
hskin(0,0,' ',80,frameclr,LIGHTGREEN,0); /*Draw charectors horizondally*/
hskin(1,0,' ',80,frameclr,LIGHTGREEN,0);
vskin(0,0,' ',24,frameclr,LIGHTGREEN,0); /*Draw charectors verticaly*/
vskin(0,79,' ',24,frameclr,LIGHTGREEN,0);
hskin(24,0,' ',80,frameclr,LIGHTGREEN,0);
vskin(0,21,' ',24,frameclr,LIGHTGREEN,0);
/* vskin(1,50,' ',12,LIGHTGREEN,LIGHTGREEN,0);*/
/*print2vdu(14,2,"ENTER YOUR CHOICE=>",14);*/
return;
}
animctr=0;
while(!kbhit())
{
getmousepos(&button,&row,&column);
time(&t);
/*Next 4 lines are just for find row & column when mouse programming
gotorc(10,60);
printf("%d %d",row,column);
delay(100);
hskin(10,60,' ',10,BLACK,WHITE,0);*/
i++;
if(button==1 && row==144 && column>=16 && column<=72) /*Exit*/
return('0');
if(button==1 && row==16 && column>=16 && column<=136) /*Add New Item*/
return('1');
if(button==1 && row==32 && column>=16 && column<=144) /*Modify Record*/
return('2');
if(button==1 && row==48 && column>=16 && column<=160) /*Display an Item*/
return('3');
if(button==1 && row==64 && column>=16 && column<=104) /*Analysys*/
return('4');
if(button==1 && row==80 && column>=16 && column<=144) /*Issue an Item*/
return('5');
if(button==1 && row==96 && column>=16 && column<=152) /*Items to order*/
return('6');
if(button==1 && row==112 && column>=16 && column<=152) /*Delete an Item*/
return('7');
if(button==1 && row==128 && column>=16 && column<=104) /*Exit*/
return('8');
}
ch=getch();
/*ch=getkey();*/
return ch;
}
issue_itm() /*This function will return 0 if item canot issued.If issued returns number of
items issued*/
{
float qnty;
displayinf();
print2vdu(15,21,"ENTER
QUANTITY=>",BLACK,WHITE,0);fflush(stdin);gotorc(15,40);
scanf("%f",&qnty);
if((stock.qty - qnty) >= stock.min) /*If the stock of the item is greater than minimum
stock*/
{
textcolor(WHITE);
textbackground(BLACK);
gotorc(18,22);
cprintf("%.4f ITEMS ISSUED",qnty);
gotorc(19,22);
cprintf("PAY RS. %.2f",qnty*stock.itmprice);getch();
textcolor(LIGHTGRAY);
stock.qty-=qnty; /*Updating quntity in stock*/
fseek(fp,-recsize,SEEK_CUR); /*Set fp to the current record's position*/
fwrite(&stock,recsize,1,fp); /*Write updated stock*/
return qnty; /*Return success*/
}
else /*Means if the stock of the item is less than minimum stock.ie Reorder level*/
{
messagebox(10,20,"INSUFFICIENT STOCK!!!","INSUFFICIENT",'
',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
gotorc(17,22);
textcolor(WHITE);
textbackground(BLACK);
cprintf("ONLY %.4f ITEMS PIECES CAN BE ISSUED",stock.qty-stock.min);
gotorc(18,22);
cprintf("Press Any KEY...");getch();
// messagebox(11,25,"ONLY _ ITEMS PIECES CAN BE
ISSURD","INSUFFICIENT",' ',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
/*Don't confuse here.Next 6 lines are used to fill up the _.See the above line*/
textcolor(LIGHTGRAY);
textbackground(BLACK);
return 0; /*Return fail*/
}
}
int billbgclr=BLACK,billfgclr=WHITE;
display_bill(int issued_itm) /*Just displays the bill when a customer purchase
something*/
{
int i,r1=3,c1=21,r2=22,c2=79;
const int startcolumn=c1;
float sum;
fillcolor(r1,c1,r2,c2,' ',billbgclr,billbgclr,0);
textcolor(billfgclr);
textbackground(billbgclr);
gotorc(r1+1,c1+10);
cprintf("BILL");
gotorc(r1+1,c1);
cprintf("CODE NAME PRICE QUANTITY TOTAL ");
r1+=2;
sum=0;
for(i=0;i<issued_itm;i++)
{
sum+=bill[i].itmprice*bill[i].qty;
c1=startcolumn;
gotorc(r1,c1);
cprintf("%s",bill[i].itmcode);
gotorc(r1,c1+=9);
cprintf("%s",bill[i].itmname);
gotorc(r1,c1+=14);
cprintf("%.2f",bill[i].itmprice);
gotorc(r1,c1+=12);
cprintf("%.2f",bill[i].qty);
gotorc(r1,c1+=12);
cprintf("%.2f",bill[i].itmprice*bill[i].qty);
r1+=1;
}
gotorc(r2,c2-startcolumn);
cprintf("GRAND SUM: %.2f",sum);
textbackground(RED);
textcolor(YELLOW);
gotorc(r2,startcolumn+1);
cprintf("PRINT BILL");
textcolor(BLACK);
textbackground(LIGHTGRAY);
fflush(stdin);
if(toupper(getch())=='P')
printbill(issued_itm);
return 1;
}
printbill(int issued_itm)
{
/*
Sorry The printer functions on this program are not tested yet
*/
int sum,i;
//e initprinter(0); /*Initialising printer*/
setdefaultcolor();
clrscr();
printf("CODE NAME PRICE QUANTITY TOTAL ");
for(i=0;i<issued_itm;i++)
{
cprintf("\n");
sum+=bill[i].itmprice*bill[i].qty;
cprintf("%s",bill[i].itmcode);
cprintf("\t %s",bill[i].itmname);
cprintf("\t%.2f",bill[i].itmprice);
cprintf("\t %.2f",bill[i].qty);
cprintf("\t %.2f",bill[i].itmprice*bill[i].qty);
// printscreen();
}
return;
}
float get_investment(void)
{
tot_investment=0;
rewind(fp);
while(fread(&stock,recsize,1,fp)==1)
tot_investment+=(stock.itmprice*stock.qty);
return tot_investment;
}
struct colors /*This structur is for save and load the above colors from a file*/
{
char cfg_name[10]; /*Name of the color configuration*/
int msgboxbrdrclr;
int msgboxbgclr;
int msgboxfgclr; /*Just for SET MESSAGE BOX COLORS it is common to all
messageboxes in this program*/
int mnutxtbgclr;
int mnutxtfgclr;
int frameclr;/*For set frame and menu items colors*/
int space1_symb;
int space1_bgclr;
int space1_fgclr;/*For set color of screen space 1.It is the region around the menu
items*/
int space2_symb;
int space2_bgclr;
int space2_fgclr;/*For set color of screen space 2.It is the region righthand side of the
menu items displayed*/
}clr;
const long int clrsize=sizeof(clr);
while(1)
{
printf("ENTER FRAME COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
frameclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("\nENTER MENU TEXT FORGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
mnutxtfgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("ENTER MENU TEXT BACKGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
mnutxtbgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("ENTER SPACE 1 BACKGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
space1_bgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("ENTER SPACE 1 SYMBOL (SEE ASCII CHART) VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 256)
{
space1_symb=color;
break;
}
else
{
printf("Invalid Symbol Value.See the Ascii table for values & Enter correct values(0
to 255)");
continue;
}
}
while(1)
{
printf("ENTER SPACE 1 FOREGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
space1_fgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("ENTER SPACE 2 BACKGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
space2_bgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
while(1)
{
printf("ENTER SPACE 2 SYMBOL (SEE ASCII CHART) VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 256)
{
space2_symb=color;
break;
}
else
{
printf("Invalid Symbol Value.See the Ascii table for values & Enter correct values(0
to 255)");
continue;
}
}
while(1)
{
printf("ENTER SPACE 2 FOREGROUND COLOR VALUE:");fflush(stdin);
scanf("%d",&color);
if( color >=0 && color <= 15)
{
space2_fgclr=color;
break;
}
else
{
printf("Invalid Color Value.See the Color table for color values & Enter correct color
values");
continue;
}
}
getch();
return;
}
setdefaultclr()
{
msgboxbrdrclr=RED,msgboxbgclr=BLUE,msgboxfgclr=YELLOW; /*Just for SET
MESSAGE BOX COLORS it is common to all messageboxes in this program*/
mnutxtbgclr=BLACK,mnutxtfgclr=YELLOW,frameclr=CYAN;/*For set frame and
menu items colors*/
space1_symb=' ',space1_bgclr=BLACK,space1_fgclr=WHITE;/*For set color of screen
space 1.It is the region around the menu items*/
space2_symb=' ',space2_bgclr=BLACK,space2_fgclr=WHITE;/*For set color of screen
space 2.It is the region righthand side of the menu items displayed*/
return 1;
}
setlastsavedcfg()
{
FILE *flast;
flast=fopen("lastcfg","rb+");
if(flast==NULL)
{
printf("\n\nConfiguration file not found!!!.Trying to load with default colors\nPress
Any Key...");getch();
setdefaultclr();
return 0;
}
rewind(flast);
fread(&clr,clrsize,1,flast); /*Read the first record.Remember this file always contains
only one record.Because when the application is exit this file is opened in wb+ mode.So
its contents are destroyed & then save the last configuration*/
#ifdef OKAY
if(strcmp(clr.cfg_name,"lastclr")!=0) /*The lastsaved configuration not found*/
{
printf("\n\nConfiguration not found!!!.Trying to load with default colors\nPress Any
Key...");getch();
setdefaultclr();
fclose(flast);
return 0;
}
#endif
msgboxbrdrclr=clr.msgboxbrdrclr;msgboxbgclr=clr.msgboxbgclr;msgboxfgclr=msgb
oxfgclr;
mnutxtbgclr=clr.mnutxtbgclr;mnutxtfgclr=clr.mnutxtfgclr;frameclr=clr.frameclr;
space1_symb=clr.space1_symb;space1_bgclr=clr.space1_bgclr;space1_fgclr=clr.spac
e1_fgclr;
space2_symb=clr.space2_symb;space2_bgclr=clr.space2_bgclr;space2_fgclr=clr.spac
e2_fgclr;
fclose(flast);
return 1;
}
save_cur_cfg()
{
FILE *flast;
flast=fopen("lastcfg","wb+"); /*Contents will be destroyed*/
if(flast==NULL)
{
messagebox(10,18,"UNABLE TO SAVE CURRENT CONFIGURATION.FILE
OPENING ERROR!!!","ERROR",' ',msgboxbrdrclr,msgboxbgclr,msgboxfgclr,0);
return 0;
}
strcpy(clr.cfg_name,"lastclr");
clr.msgboxbrdrclr=msgboxbrdrclr;clr.msgboxbgclr=msgboxbgclr;msgboxfgclr=msgbox
fgclr;
clr.mnutxtbgclr=mnutxtbgclr;clr.mnutxtfgclr=mnutxtfgclr;clr.frameclr=frameclr;
clr.space1_symb=space1_symb;clr.space1_bgclr=space1_bgclr;clr.space1_fgclr=space1
_fgclr;
clr.space2_symb=space2_symb;clr.space2_bgclr=space2_bgclr;clr.space2_fgclr=space2
_fgclr;
rewind(flast);
fwrite(&clr,clrsize,1,flast);
fclose(flast);
return 1;
}
animctr+=1;
if(animctr+5 >= len) animctr=0;
// }
return;
}
CONCLUSION