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:

  1. Functional Requirements:
    1. Accept cash input in value of 1, 2 or 5 rupee coins.
    2. Accept credit card (with credit limit).
    3. Accept debit card (with PIN number and balance).
    4. Serve coffee with sugar and creamer for Rs.10/-.
    5. Serve black coffee without sugar and cream for Rs.6/-.
    6. Put correct amount of money on credit card and debit card.
  2. Output Requirements:
    1. Display the total amount of money after inputting the cash.
    2. Display error message when there is no enough money, over credit limit, balance below zero, insert invalid cash, or input invalid command.
    3. Display receipt after each transaction.
  3. Constraints:
    1. 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.
    2. After each transaction, user should re-enter the credit card or debit card to perform another transaction.
    3. 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.
    4. 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
  4. Environment:
    1. Character mode interface.
    2. 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)

  1. Write an assembly language program to accept a decimal number and display it's two's complement representation in binary and hexadeimal formats.
  2. 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.
  3. 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.
  4. Write an assembly language program to implement the queue management.

 

Hosted by www.Geocities.ws

1