IGNOU Master of Computer Applications (MCA) :: Assignments

Course Code MCS-011
Course Title Problem Solving and Programming
Assignment Number MCA(1)/011/Assign/07
Maximum Marks 100
Weightage 25%
Last Date of Submission 15th April, 2007

There are five questions in this assignment, which carries 80 marks. Rest 20 marks are for viva-voce. Answer all the questions. 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.

Q1: (20 Marks)

Write an interactive program that reads three (3) lists of numbers, which are stored in three separate files, and creates one (1) sorted list. Each file should contain not more than 15 numbers. First, you need to create a program that randomly chooses a size (<= 15 numbers) for the list1 and then randomly generates a list of numbers and store them in the file1. Repeat this procedure to select the other two lists ( list2 and list3) and stores them in the corresponding files (file2 and file3) for sorting and merging them into one.

file1(list 1) 32 12 5 990 1

file2 (list 2) 2000 3
file3 (list 3) 30 6
Output in a separate file:

1 3 5 6 12 30 32 990 2000

Q2: (10 Marks)

Write a program to generate a bar chart for a list of numbers, where each number is between -10 and 10. Given a list of numbers, your program needs to first sort the numbers. Your program should then generate the bar chart where the left hand side represents the negative values and the right hand side represents the positive values (see example output below). Your bar chart should only use the * , | and space characters.

Example:
Input: 10 –5 5 –10 0
Sorted list: -10 -5 0 5 10

Output:

Bar Chart

|**********| |
| *****| |
| | |
| |***** |
| |**********|
Q3: (20 Marks)

Write a program to transform its input according to a specified transformation scheme. The transformation scheme will consist of two strings: a string of characters and then a string of replacement characters. The idea is that your program replaces every instance of the ith character in the initial string with the (i+3) character (of English alphabets) in the replacement string. When no substitution is defined for a character, the program just passes it through to the output unchanged. The program should inform the user of any errors in the transformation scheme. Your program should display the phrase before and after the substitutions have been made.
Example:
Original String: This is a C program.
String after the transformation: Wklv lv d F Surjudp.

Q4: (20 Marks)

Write an interactive program called “CONVERTER” that accepts the currency of other nations and displays the equivalent currency in Indian Rupees.

Q5: (10 Marks)

Write an interactive program to generate pay-slips for the employees of a company.
Note: Assumptions can be made wherever necessary.

 

Hosted by www.Geocities.ws

1