Sie sind auf Seite 1von 5

PIXELES CLASSES

BCA & MCA (IGNOU)

Course Code : BCSL-021


Course Title : C Language Programming
Assignment Number : BCA (II)/L-021/Assignment/2015
Maximum Marks : 50, Weightage
: 25%
This assignment has only one question. Answer the question. This question carries 40 marks. Rest
10 marks are for viva voce. You may use illustrations and diagrams to enhance the explanation.
Please go through the guidelines regarding the assignments given in the programme guide for the
format of presentation.
1. Write an interactive C program to perform weekly production and sales analysis of a company
which prompts the user with the following options on the main menu:
1) Information about the Company
2) Details/Specifications of their Five Products
3) Price list of their Five Products
4) Weekly Matrix of Production and Sales
5) Total value of weekly Production and Sales
6) Grand total value of Production and Sales
7) Quit
Enter your choice:
If 1 is entered, should display the information about the Company. If 2 is entered, it should give
the details/specifications about their 5 products. If 3 is entered, it should display the prices of
their 5 products. If 4 is entered week-wise production and sales need to be shown after entering
the values by the user. If 5 is entered total value of weekly production and sales need to be
displayed. If 6 is entered grand total value of production and sales need to be displayed. And 7 is
for Quit the program. If the user enters any letters or numbers other than the choice, redisplay the
prompt. All outputs should go to the terminal and all inputs should come from the keyboard.
(40 Marks)
Note: You must execute the program and submit the program logic, sample input and output along
with the necessary documentation for this practical question. Assumptions can be made wherever
necessary.
Ans:
#include<stdio.h>
char prd[][15]={"Notebook","Pen","Pencil","Guide-book","Eraser"};
char price[]={20,10,5,40,3};
int i,q[5],s[5],tq=0,ts=0;

www.pixelesindia.com

PIXELES CLASSES

Page | 1

PIXELES CLASSES

BCA & MCA (IGNOU)

char prd_qty[5];
char prd_sales[5];
void company()
PIXELES CLASSES

Page | 2

clrscr();

We are teaching IGNOUs BCA &

printf("PIX Pvt. Ltd");


printf("\nAddress:19,Nangloi,Delhi-110041");

MCA Students

printf("\nContact:011-3456789");

Why join us?

}
void product()

Regular Classes

BCA & MCA IGNOU Special

clrscr();

Institute

printf("\nItems details are...\n");


printf("%s :\t Long size Notebook\n",prd[0]);

Free Trial Classes

printf("%s :\t Ball Pen with different colour\n",prd[1]);

Subjective Knowledge

printf("%s :\t 4BH Pencil\n",prd[2]);

Free PIXELES Guide Books

printf("%s :\t PIXELES Succes Key\n",prd[3]);


printf("%s :\t Dust Free Eraser\n",prd[4]);
}

(Prepared by our teachers)


Free Solved Assignments
Experienced Faculties

void disp_price()
{

100% Results

clrscr();

Home Test Series

printf("\n*****Product price List*****\n");


for(i=0;i<=4;i++)
printf("%s --> Rs.%d.00\n",prd[i],price[i]);

Class Test Series


We teach you until you pass

Final Year Synopsis & Project

void input_prd_sale()

Proper Guidance

{
clrscr();
printf("\nEnter production and sale in this week\n");

www.pixelesindia.com

PIXELES CLASSES

BCA & MCA (IGNOU)

for(i=0;i<=4;i++)
{
printf("Enter the Product qty of %s -->",prd[i]);
scanf("%d",&q[i]);

PIXELES CLASSES

printf("Enter the Sales qty of %s -->",prd[i]);


scanf("%d",&s[i]);
}
clrscr();
}
void output_prd_sale()
{
clrscr();
printf ("\nProduction & Sales Details\n");
for(i=0;i<=4;i++)
printf("Product=%s \t Product_qty=%d \t Sales_qty =%d\n",prd[i],q[i],s[i]);
}
void total()
{
clrscr();
for(i=0;i<=4;i++)
{
tq=tq+q[i];
ts=ts+s[i];
}
printf("\nTotal Product Qty=%d\n",tq);
printf("\nTotal Product sale=%d\n",ts);
}
void main()
{
int ch,c=0;
clrscr();

www.pixelesindia.com

Page | 3

PIXELES CLASSES

BCA & MCA (IGNOU)

do
{
printf("\n\n***** Menu List *****\n");
printf("1) Information about the Company\n");
printf("2) Details/Specifications of their Five Products\n");
printf("3) Price list of their Five Products\n");
printf("4) Input Weekly Matrix of Production and Sales\n");
printf("5) Display value of weekly Production and Sales\n");
printf("6) Grand total value of Production and Sales\n");
printf("7) Quit\n");
printf("Enter your choice:\n");
scanf("%d",&ch);
//ch=getchar();
switch(ch)
{
case 1:
company();
break;
case 2:
product();
break;
case 3:
disp_price();
break;
case 4:
input_prd_sale();
break;
case 5:
output_prd_sale();
break;
case 6:

www.pixelesindia.com

PIXELES CLASSES

Page | 4

PIXELES CLASSES

BCA & MCA (IGNOU)

total();
break;
case 7:
break;

PIXELES CLASSES

default:

Page | 5

printf("Wrong choice\n");
}
}while(ch!=7);
getch();
}

Branches & Contacts Details


Uttam Nagar:-WZ-B7, Old Pankha
Road (Opp. Primary School), Near
East Metro Station, Uttam Nagar,
New Delhi-59

Nangloi:-Plot. No-19, Ext- 2A,


oppBanke-Bihari, Talabwali Road,
Nangloi, Delhi-41

Ph: 9213327975, 9716339580


8750321695

pixeles@rediffmail.com, web: www.pixelesindia.com

www.pixelesindia.com

Das könnte Ihnen auch gefallen