Pages

Thursday, November 4, 2010

Mgt613 GDB No. 1

Total Marks 20
Starting Date Thursday, November 04, 2010
Closing Date Monday, November 08, 2010 Status OpenQuestion/Description


Question: Given the weekly demand data, what are the exponential smoothing forecasts for periods 2-05 using a=0.10?

Week
Demand 0.1 1 980 2 825 3 760 4 650 5

Note: Calculation along with the formula is required for each period's forecast. Students who give answers without calculation will be given low marks/no marks.

CS401 Assignmen...

CS401- Computer Architecture and Assembly Language Programming
Assignment # 1
Fall 2010
Total Marks: 20
Due Date
Your assignment must be uploaded before or on 8th Nov 2010.
Upload Instructions
Please view the document related to assignment submission process provided to you by the Virtual University to upload the assignment.
Rules for Marking
Kindly note that your assignment will NOT be graded if:
§ It is submitted after due date
§ The file you uploaded does not open
§ The file you uploaded is copied from someone else
§ It is in the format other than .doc
Objective
This assignment has been designed to enable you:
§ To understand how effective address is calculated
§ To understand how physical memory address is calculated
§ To understand Register
§ To understand the use of debugger and how to read value from Debugger

Assignment

Question_1: [marks: 5]
What is the effective address generated by each of the following instruction?
Initially AX= 0x0FED, BX=0x0400, label=0x04201, and SI=0x00E1
(Offsets in part a, b and f are in decimal)
  1. mov ax, [bx+65]
  2. mov bx, [ax+35]
  1. mov ax, [bx+label]
  2. mov bx, [label+ax]
  1. mov bx, [ax+si]


Question_2: [marks: 5]
Calculate the physical memory address generated by the following segment:offset pairs (both are hexadecimal values).
  1. 0000:FFFF
  2. 0100:0100
  1. DEF8:2222
  2. 543F:3254
  1. FFFF:AAAA

Question_3:
Write the given program, assemble it and then analyze it in Debugger [marks: 10]

[org 0x0100]
mov al, [num1]
mov bl, [num1+1]
mov bl, [num1+2]
add al, bl
mov ax, 0x4c00
int 0x21

num1: db 5, 10, 15, 0

After analysis you have to provide all information that is asked under:

al,bl and IP Register

You have to fill the table given below and write the values of al,bl and IP registers before and after execution of an instruction as you analyze in debugger. You also have to give reason that why the value of al,bl and IP registers change after a particular instruction. Give reason in corresponding column.

Instruction
Before Execution
After Execution(with Reasons)
Value of al
Value of bl
Value of IP
Value of al
Value of bl
Value of IP
mov al,[num1]






mov bl,[num1+1]






add al,bl






mov bl,[num1+2]






add al,bl






mov [num1+3],al







You also have to provide the following information

Address of num1=?
Address of num1+1=?
Address of num1+2=?
Address of num1+3=?
Value of num1+3(at end of program) =?

Note:Do it youself.Cheating case will be awarded with zero

Solution:

Question_1: [marks: 5]
What is the effective address generated by each of the following instruction?
Initially AX= 0x0FED, BX=0x0400, label=0x04201, and SI=0x00E1
(Offsets in part a, b and f are in decimal)

  1. mov ax, [bx+65]
  2. mov bx, [ax+35]
  1. mov ax, [bx+label]
  2. mov bx, [label+ax]
  1. mov bx, [ax+si]

Question_2: [marks: 5]
Calculate the physical memory address generated by the following segment:offset pairs (both are hexadecimal values).

  1. 0000:FFFF=0FFFF
  2. 0100:0100=01100
  1. DEF8:2222 = E11A2
  2. 543F:3254=57644
  1. FFFF:AAAA=10AA9A =0AA9A wrap around

Question_3:
Write the given program, assemble it and then analyze it in Debugger [marks: 10]

[org 0x0100]
mov al, [num1]
mov bl, [num1+1]
mov bl, [num1+2]
add al, bl
mov ax, 0x4c00
int 0x21


num1: db 5, 10, 15, 0


After analysis you have to provide all information that is asked under:

al,bl and IP Register

You have to fill the table given below and write the values of al,bl and IP registers before and after execution of an instruction as you analyze in debugger. You also have to give reason that why the value of al,bl and IP registers change after a particular instruction. Give reason in corresponding column.

Instruction
Before Execution
After Execution(with Reasons)
Value of al
Value of bl
Value of IP
Value of al
Value of bl
Value of IP
mov al,[num1]
0000
0000
0100
0005
0000
0103
mov bl,[num1+1]
0005
0000
0103
0005
000A
0107
add al,bl
0005
000A
0107
000F
000A
0109
mov bl,[num1+2]
000F
000A
0109
000F
000F
010D
add al,bl
000F
000F
010D
001E
000F
010F
mov [num1+3],al
001E
000F
010F
001E
000F
0112


You also have to provide the following information

Address of num1=0117
Address of num1+1=0118
Address of num1+2=0119
Address of num1+3=011A
Value of num1+3(at end of program) =?
.....................
Another Solution:





.........

Differences between Linked List and Arrays


Linked lists are data structure which is the self-referential class objects called nodes. Each node is connected by reference links. Make yourself clear that linked lists are not dynamically sized array.
An array is data structure (type of memory layout) that stores a collection of individual values that are of the same data type. Arrays are useful because instead of having to separately store related information in different variables (named memory locations), you can store them—as a collection—in just one variable. It is more efficient for a program to access and process the information in an array, than it is to deal with many separate variables.
Consider the following points of differences between the two:

Linked Lists

Arrays

1.
Linked lists allow only sequential access to elements. Thus the algorithmic complexities is order of O(n)
1.
Arrays allow random access to its elements and thus the complexity is order of O(1)
2.
Linked lists require an extra storage for references. This makes them impractical for lists of small data items such as characters or boolean values.
2.
Arrays do not need an extra storage to point to next data item. Each element can be accessed via indexes.
3.
The size of Linked lists are dynamic by nature.
3.
The size of array is restricted to declaration.
4.
Elements can be inserted and deleted in linked lists indefinitely.
4.
Insertion/Deletion of values in arrays are very expensive. It requires memory reallocation.

Differences between Array and stack

Answer

Briefly, there are two main differences between an array and a stack. Firstly, an array can be multi-dimensional, while a stack is strictly one-dimensional. Secondly, an array allows direct access to any of its elements, whereas with a stack, only the 'top' element is directly accessible; to access other elements of a stack, you must go through them in order, until you get to the one you want.


--

Mgt613 GDB No. 1 Announced

“Production Operations Management (MGT613)”

This is to inform that Graded Discussion Board (GDB) (covering video lecture no. 1 to lecture no 14) will be opened according to the following schedule

Opening Date and Time
November 04, 2010 At 12:01 A.M. (Mid-Night)


Closing Date and Time
November 08, 2010 At 11:59 P.M. (Mid-Night)


Topic for Discussion

“Forecasting”

Note: The discussion question will be from the topic mentioned above. So start learning about the topic now.

Mgt211 GDB

Mr. Ali has invested Rs. 50,000 in Ahmad enterprise. The firm has recently declared bankruptcy and has Rs. 100,000 in unpaid debts. Explain the nature of payments by Mr. Ali with respect to the extent of liability (Limited or Unlimited) in each of the following situations.

1. Ahmad enterprise is a sole proprietorship owned by Mr. Ali.
2. Ahmad enterprise is a 50-50 partnership of Mr. Ali and Mr. Ahmad
3. Ahmad enterprise is a private limited company
4. Ahmad enterprise is a public limited company

Your answer must be in following format


Question



Answer


A


Limited or Unlimited


B


Limited or Unlimited


C


Limited or Unlimited


D


Limited or Unlimited

regards,

Announcement about Assignment and Quiz

Dear Students,

Due to some unavoidable circumstances, the LMS Website of Virtual University of Pakistan is not working properly, which is causing lot of trouble to the students who are trying to upload assignments. Therefore it has been decided that Assignment No.1 will be acceptable till 04-11-2010 sent on course e-mail id only if sent using VU e-mail ID.
Note: Put your assignment in mail for only one time, if multiple copies were found then it will not be considered for marking.

You can send your assignments at E-mail address


Furthermore this is also causing lot of trouble to the students who are trying to attempt the Quiz .Do not worry about the result of this Quiz No.1 and prepare for coming activities wholeheartedly


Please note that this quiz will not be counted as a graded activity and therefore has no affect on your grades.

CS201 Assignment Solution

Instructions: Please read the following instructions carefully before submitting your assignment:
It should be clear that your assignment will not get any credit if:
§ The assignment is submitted after due date.
§ The submitted assignment does not open or file is corrupt.
All types of plagiarism are strictly prohibited.
Note:You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. If you will submit code any other file format like .doc or .txt etc. you will get zero marks.
Objective
The objective of this assignment is to provide hands on experience of using
§Basic concepts of C/C++ language and Programming
§Writing, Compiling and Executing a C program
§Conditional statements of C language
§Loops in C language
Guidelines
§Code should be properly aligned and well commented.
§Follow C/C++ rules while writing variables names, function names etc.
§Use only Dev-C++ IDE for this assignment.
Assignment

Problem Statement: Calculating No. of A Grades in Class

You are required to write a program which should take input from user in the form of characters A or B. Based upon user's input you should calculate no. of A grades. You should use while loop or do/while loop for taking input and if / else condition for making decisions.

Detailed Description:

The program should display like;
Please Enter Grade ('A' OR 'B' )
Then the program should take 10 inputs one by one,

  • After taking 10 inputs, you should display no. of A grades.
  • If A grades are less than or equal to 2, you should display a message "Your class is Poor!".
  • If A grades are less than or equal to 7, you should display a message "Your class is Good!".
  • If A grades are greater than or equal to 8, you should display a message "Your class is Brilliant!".
  • The user should enter either A or B. If user has entered other than A or B, e.g. C,D,E etc. Your program should display a message like;
"Please Enter 'A' or 'B' grade only!"


Sample Input and Output


Please Enter Grade of student 1 : A Please Enter Grade of student 2 : A Please Enter Grade of student 3 : B Please Enter Grade of student 4 : A Please Enter Grade of student 5 : B Please Enter Grade of student 6 : B Please Enter Grade of student 7 : A Please Enter Grade of student 8 : B Please Enter Grade of student 9 : CPlease Enter 'A' or 'B' grade only! Please Enter Grade of student 9 : A Please Enter Grade of student 10 : A



Total No. of A Grades = 6



Your Class is Good!


Deadline:
Your Assignment solution must be uploaded/submitted on or before November 05, 2010

SOLUTION:

using namespace std;

#include
#include


main()

{
int totalstudent=1;
int A =0,B=0;

char grad(1);

while (totalstudent <= 10)
{
cout"Please Enter Grade of student "totalstudent" :\n";
cin>>grad;
if (grad=='a' or grad =='A')
{
A = A+1;
totalstudent++;
}
else if (grad=='b' or grad =='B')
{
B += 1;
totalstudent++;
}
else
{
cout"\nPlease Enter 'A' or 'B' grade only! \n";

}
}

cout"Total No. of A Grades "A" :\n";


if (A <=2)
{
cout"\nYour class is Poor!\n";
}else if (A <=7)
cout"\nYour class is Good!\n";
else
{
cout"\nYour class is Brilliant!\n";
}
getche();

}

Is this blog is useful for you?

Powered by Blogger.