|
|
IGNOU Master of Computer Applications (MCA) :: Assignments
| Course Code |
MCSL-017 |
| Course Title |
C and Assembly Language Programming |
| Assignment Number |
MCA(1)/017/Assign/07 |
| Maximum Marks |
100 |
| Weightage |
25% |
| Last Date of Submission |
30th April, 2007 |
This assignment has two sections. Answer all the question in each
sections. Each Section is of 20 marks. Your Lab Records will carry
40 Marks. Rest 20 marks are for viva voce. You may use illustrations
and diagrams to enhance the explanations. Please go through the guidelines
regarding assignments given in the programme guide for the format of
presentation.
Section 1: C Programming Lab
Q1:
ECoffeeVendor is a program, which simulate a coffee machine. The coffee machine
serves coffee with sugar and creamer for Rs.10/- and Rs.6/- without sugar and
creamer (black coffee). The coffee machine accepts cash in value of Rs.1/-,
Rs.2/- and Rs.5/- coins, as well as credit cards and debit cards. Detailed
specification is as follows:
- Functional Requirements:
- Accept cash input in value of 1, 2 or 5 rupee coins.
- Accept credit card (with credit limit).
- Accept debit card (with PIN number and balance).
- Serve coffee with sugar and creamer for Rs.10/-.
- Serve black coffee without sugar and cream for Rs.6/-.
- Put correct amount of money on credit card and debit card.
- Output Requirements:
- Display the total amount of money after inputting the cash.
- Display error message when there is no enough money, over
credit limit, balance below zero, insert invalid cash, or input
invalid command.
- Display receipt after each transaction.
- Constraints:
- One cup of white coffee contains one unit of coffee powder,
sugar and creamer, while one cup of black coffee only contains
one unit of coffee powder and water. For the coffee machine,
there is a limit capacity of the coffee powder, sugar and creamer.
If there isn't enough coffee powder available, the coffee machine
cannot serve the black coffee. And if there is not enough coffee
powder, sugar and creamer, the coffee machine cannot serve
the white coffee. When the coffee machine cannot fulfill the
user request, the money should be refunded to users.
- After each transaction, user should re-enter the credit card
or debit card to perform another transaction.
- he limit capacity, the credit card and the debit card information
will be stored in three different files, and will be read in
when the program is launched. If the initial capacity cannot
serve for at least one cup of coffee, print out an error message,
if the format of credit card and debit card files is not correct,
print out error messages.
- Related files are:
- ingredient.dat – Coffee, Sugar and creamer limits
- debitCard.dat - Debit card number, PIN and Balance
- creditCard.dat - Credit card number, credit limit
- Environment:
- Character mode interface.
- Develop using C programming language.
Note: You must execute the program and submit the program logic, sample
input and output along with the necessary documentation for this question
. Assumptions can be made wherever necessary.
Section 2: Assembly Language Programming Lab
Q1: (5+5+5+5=20 Marks)
- Write an assembly language program to accept a decimal number and
display it's two's complement representation in binary and hexadeimal
formats.
- Write an 8086 assembly language program that will compute:
2.0* log10 X for x = 0.1, 1.0, 10.0, 100.5, 1000.0, and six other values
using a loop.
All values are in the single-precision (short real) format.
- Write a program that will input a positive integer and print out
the list of its prime factors. Comment on the run time of your algorithm
and state any limitations that you have imposed on the input integers.
- Write an assembly language program to implement the queue management.
|