Showing posts with label Virtual University Past Papers. Show all posts
Showing posts with label Virtual University Past Papers. Show all posts

Challenging Question


Deadline


Your Challenge Code must be uploaded/submitted at or before16th May 2003

Uploading instructions


Please view the assignment submission process document provided to you by the Virtual University to upload the challenge code.

Objective


The objective of this Challenge Question is for the students to devise very simple and efficient logic for simple problems.

Challenge Question

Write a program that takes the first 100 non-zero integers, that is the numbers 1-100in RANDOM order, and stores these numbers into an array of size 100. (You may choose to hard code the numbers in the program or take input from the keyboard). The program then sorts the array in ascending order and displays the sorted array on the screen.

Challenge

The challenge is it to write the sorting routine/function in such a way that there are:
·        Minimum number of variables
·         No second array to store data for temporary use
·        Minimum number of loops.
·         Minimum number of operations (an iteration of a loop or a swap of two numbers will count as an operation).
Note:

Make the variable names self–explanatory. Comment and Indent your code properly to make it more understandable.



Assignment No. 8


Deadline


Your assignment must be uploaded/submitted before or on 13th May 2003

Uploading instructions


Please view the assignment submission processdocument provided to you by the Virtual University to upload the assignment.

 

Rules for Marking


It should be clear that your assignment will not get any credit if:

o                   The assignment is submitted after due date
o                   The submitted assignment does not compile or run
o                   The assignment is copied


Objective


The objective of this assignment is to provide hands on experience of:

  • Utilizing Structures in C.
  • Allocating memory dynamically in C.
  • Making your own header file and using it in your .cpp files..
  • Using Parameterized macros in C.
  • File handling mechanism in C.


Assignment

Write a C program that allow the user to enter employees data and calculate the total amount of salaries of all the employees whose data is entered. Your program should ask the user about the number of Employee Records he/she want to enter. After taking input from the user your program should dynamically allocate the memoryfor the number of Employee Records entered and calculate Total Net Pay Of All Employees and Also save all records in a File.







The Structure of Employee Record should have the following attributes.

1: Employee ID.
2: Employee Name.
3: Employee salary.
4: Employee net pay.

 In your code you should use
  • File handling mechanism,
    • Open/create a file
    • Write/append data to the opened file
    • Close the file 



For each Employee Record your program should take Employee ID, Employee Name and Employee Salary from the keyboard. You can calculate Net Payfor each employee by using the following formula.

          Net Pay = employee salary –Tax
          where
                     Tax        = 5% of Employee Salary

Use Parameterized Macronamed net Pay. This Macro should use the above formula and it should take two parameters Employee Salary and Tax and calculates the Net Pay.

Your output on the screen should be like:

Please enter the number of Records you want to enter     :   2


Employee ID#                 :        0026
Employee Name              :        Ali
Employee Salary             :         5000

Employee ID#                 :        0027
Employee Name              :        Shan
Employee Salary             :         5500


Total Net Pay Of All Employees     :  9975

Press any key to continue……..



  Declare yourstructure named Employee in a header file and then include this header file in your .cpp file 



How you can create your own header file:

Create a folder with a name  Assignment6

Open your Dev c++ and write your header file


Example to create your HEADER FILE:

int square(int x)
{
      return  x*x;   

}
The above code is just an example you should write structure instead of a function.

After writing the structures in the header file, save this file in a folder “Assignment6” as  myHeaderFile.h, You can also compile the program to check errors..


Suppose if you create the folder “Assignment6” in Drive D:

The path will be “D:\Assignment6\myHeaderFile.h”.

o       Now write your .cpp file
o       Your .cpp and myHeaderFile.h should be saved in the same Folder.

Example to explain how you can include your header file in .cpp file

#include <iostream.h>
#include <conio.c>
#include “myHeaderFile.h”


void main(void)
{
     cout << square(4);

    getch();
}
The above code is just an example you should use structure instead of a function


Save your .cpp  file as Assign6 in folder Assignment6

The path will be “D:\Assignment6\Assign6.cpp”.


The difference between including the file in quotation marks and angle brackets

  • When we include the file in angle brackets like #include <myHeaderFile.h>, the compiler looks in a specify directory specified in Dev-Cpp IDE include directories option.
  • When we use quotation marks like #include “myHeaderFile.h”, the compiler look into the current working directory


Assignment submission instructions:

Submit  both .cpp and .h files.

You should zip your .h(header file) and .cpp files as Assignment.zip andupload it. 

Assignment No. 5


Deadline


Your assignment must be uploaded/submitted before or on 15th April 2003

Uploading instructions


Please view the assignment submission process document provided to you by the Virtual University to upload the assignment.

 

Rules for Marking


It should be clear that your assignment will not get any credit if:

o              The assignment is submitted after due date
o              The submitted assignment does not compile or run
o              The submitted assignment is not in .cpp format
o              The assignment is copied


Objective


The objective of this assignment is to provide hands on experience of

Ø File handling mechanism in C
Ø Searching in files



Assignment

Write a program that takes a word from the user and display the number of times it appears in the given file.

o  Write a function which checks the valid input.
      Valid input means that it will fulfill the following two conditions.

1. At least one character should be entered.
2. No space between the Word.





Your output on the screen should be like:
            
 Enter the word                  :        is


The Word ‘is ‘repeats 3 times in a File.


Do you want to continue (y/n) ……. y

Enter the word                   :    is not

No space allowed please enter the word again

Enter the word                   :      statement

The Word ‘statement ‘repeats 1 times in a File.


Do you want to continue (y/n) …….y

Enter the word                  :        read


The Word ‘read’ does not exist in the File

Do you want to continue (y/n) …….n




Note

Create a folder with a name as “Assignment5” and create a new text file with a name as “Assign5” and copy paste the following paragraph and save it



Paragraph

"It is a sarcastic statement about modern education, and it means that the modern education is not developing critical skills like planning, organizing and paying attention to detail. Practically, in our day to day lives we are constantly planning, organizing and paying attention to fine details if we want our plans to succeed. And it is also fun to do these activities. For example, for a picnic trip we plan where to go, what to wear, what to take for lunch, organize travel details and have a good time while doing so."

Suppose if you create this folder in Drive D:
The path will be “D:\Assignment5\Assign5”.

Your .cpp file and Assign5.txtshould be saved in the same folder.

Read the above specifications and:
a)Write a C program to solve the problem based on your flow-chart

Submit ONLY the .cpp file as your assignment.




 

Challenging Question

 

Deadline


Your Challenge Code must be uploaded/submitted at or before 9th April 2003

Objective


The objective of this Challenge Question is for the students to:

o                   Produce the most efficient code
o                   Enhance Analysis skill and devise better logic
  

Challenge Question

           
            Write a small C Program that inputs a sentence from the user and displays the entered sentence in reverse order. For example, if the user inputs

this is a test

and press enter key , the program displays

test a is this

Challenge


Write this code without any loops structure. And do not use any extra string for the purpose of temporary storage of input values.

Hint:

You may use cin.get(); 

Note:

 Make the variable names self–explanatory. Commenting the code properly and Indent your code properly for making it more understandable.


Assignment No. 5

 

Deadline


Your assignment must be uploaded/submitted on or before 4th April 2003

Uploading instructions


Please view the assignment submission processdocument provided to you by the Virtual University to upload the assignment.

Rules for Marking


It should be clear that your assignment will not get any credit if:

o                   The assignment is submitted after due date.
o                   The submitted assignment does not compile or run.
o                   The assignment is copied.

Objective


The objective of this assignment is to provide an on hand experience of:

o                   Declaring and manipulating Arrays.
o                   Declaration and manipulation of the pointers.
o                   Sorting and searching in an Array.


Assignment


Write a C program that takes integer values from the keyboard, stores them in an array and then sorts (ascending order) that array of 10 elements with the help of pointers. Your program should display the sorted array. Further more the program should search a number entered by the user, from the sorted array and print its index in the array.

 

 


Sample Output


Please enter the value for Input [0]:               4
Please enter the value for Input [1]:             12
Please enter the value for Input [2]:             18
Please enter the value for Input [3]:             45
Please enter the value for Input [4]:             23
Please enter the value for Input [5]:             11
Please enter the value for Input [6]:               36
Please enter the value for Input [7]:               54
Please enter the value for Input [8]:               8
Please enter the value for Input [9]:               64

The sorted Array is:
4
8
11
12
18
23
36
45
54
64

Enter the number whose index is to be searched: 54

The number exists at:  Input [8]


Note:
 If the number entered for the search from the keyboard is not found then a message saying “This number does not exist in this Array” should appear like:


Enter the number whose index is to be searched: 22

This number does not exist in this Array

Important Note


            You can improve your assignment by

·        making the variable names self–explanatory
·        commenting the code properly
·        indenting the code properly for making it more understandable

Submit ONLY the .cpp file as your assignment.
Virtual University of Pakistan Final Term Past Paper of ACC501- Business Finance Fall 2008

 FINALTERM EXAMINATION

                                                                                         Fall 2008
ACC501- Business Finance (Session – 1)
Marks: 81
Question No: 1 ( Marks: 1 ) – Please choose one
The accounting definition of income is:
Income = Current Assets
Current Liabilities
Income = Fixed Assets
Current Assets
Income = Revenues
Current Liabilities
Income = Revenues
Expenses
Question No: 2 ( Marks: 1 ) – Please choose one
What would be the capital spending for an organization who has purchased fixed
assets of Rs. 200,000 and sold fixed assets of Rs. 45,000?
Rs. 245,000
Rs. 200,000
Rs. 155,000
Rs. 45,000
Question No: 3 ( Marks: 1 ) – Please choose one
Selected information from SNT Company’s accounting records is as follows:
o Cash paid to retired common shares Rs. 15,000
o Proceeds from issuance of preferred shares Rs. 20,000
o Cash dividends paid Rs. 8,000
o Proceeds from sale of equipment Rs. 25,000
On its cash flow statement for the year, SNT Company should report net cash
flow from financing activities as:
Rs. 3,000 net cash inflow
Rs. 3,000 net cash outflow http://vustudents.ning.com
Rs. 8,000 net cash inflow
Rs. 8,000 net cash inflow
Question No: 4 ( Marks: 1 ) – Please choose one
SNT Company has a current ratio of 3:2. Current Liabilities reported by the
company are Rs. 30,000. What would be the Net Working Capital for the
company?
Rs. 45,000
Rs. 15,000
( Rs. 45,000)
( Rs. 15,000)
Question No: 5 ( Marks: 1 ) – Please choose one
Which of the following would not improve the current ratio?
Borrow short-term to finance additional fixed assets
Issue long-term debt to buy inventory
Sell common stock to reduce current liabilities
Sell fixed assets to reduce accounts payable
Question No: 6 ( Marks: 1 ) – Please choose one
Which of the following are incorporated into the calculation of the Du-Pont
Identity?
I. Return on assets
II. Equity Multiplier
III. Total Assets Turnover
IV. Profit Margin
I, II, and III only
I, III, and IV only
http://vustudents.ning.com
II, III and IV only
I, II, III, and IV
Question No: 7 ( Marks: 1 ) – Please choose one
The concepts of present value and future value are:
Directly related to each other
Not related to each other
Proportionately related to each other
Inversely related to each other
Question No: 8 ( Marks: 1 ) – Please choose one
Which of the following is a special case of annuity, where the stream of cash flows
continues forever?
Special Annuity
Ordinary Annuity
Annuity Due
Perpetuity
Question No: 9 ( Marks: 1 ) – Please choose one
Which of the following is an unsecured bond for which no specific pledge of
property is made?
Mortgage
Debenture
Collateral
Note Payable
http://vustudents.ning.com
Question No: 10 ( Marks: 1 ) – Please choose one
Which of the following type of return refers to the percentage change in the
amount of money you have?
Nominal return
Real return
Inflation return
None of the given option
Question No: 11 ( Marks: 1 ) – Please choose one
When real rate is _____, all interest rates will tend to be _____.
Low; higher
High; lower
High; higher
None of the given options
Question No: 12 ( Marks: 1 ) – Please choose one
Which of the following is the extra yield that investors demand on a taxable bond
as a compensation for the unfavorable tax treatment?
Interest rate risk premium
Inflation risk premium
Default risk premium
Taxability premium
Question No: 13 ( Marks: 1 ) – Please choose one
In which type of the market, previously issued securities are traded among
investors ?
http://vustudents.ning.com
Primary Market
Secondary Market
Tertiary Market
None of the given options
Question No: 14 ( Marks: 1 ) – Please choose one
Place the following items in the proper order of completion regarding the capital
budgeting process.
(I) Perform a post-audit for completed projects;
(II) Generate project proposals;
(III) Estimate appropriate cash flows;
(IV) Select value-maximizing projects;
(V) Evaluate projects.
II, V, III, IV, and I
III, II, V, IV, and I
II, III, V, IV, and I
II, III, IV, V, and I
Question No: 15 ( Marks: 1 ) – Please choose one
An investment will be ___________ if the IRR doesn t exceeds the required return
and ___________ otherwise.
Accepted; rejected
Accepted; accepted
Rejected; rejected
Rejected; accepted


Assignment No. 4


Deadline


Your assignment must be uploaded/submitted before or on 24th March 2003

Uploading instructions


Please view the assignment submission process document provided to you by the Virtual University to upload the assignment.

 

Rules for Marking


It should be clear that your assignment will not get any credit if:

o                   The assignment is submitted after due date
o                   The submitted assignment does not compileor run
o                   The assignment is copied


Objective


The objective of this assignment is to provide hands on experience of writing user–defined functions and utilizing some useful functions in the C header files. After the completion of this assignment you would be able to:

o                   Write your own functions in C language
o                   Use few functions of conio.c for a better user interface

Console Operations

C provides a facility of console (at command prompt) functions for better output of your program. Following are two useful functions:

o       clrscr ( ) ;

You can use this function whenever you want to clear the command prompt window. It will remove all the contents of the output window and then you can display anything you want on the cleared screen. It will be displayed on the top left corner and the rest of the screen will be cleared.

o       getch ( ) ;

You can use this function whenever you want to stop your program at a certain point. You should have noticed the system (“PAUSE”); function in your Dev C++ editors. It stops your program at the end and you receive a message
“Press any key to continue. . . .”

By using getch ( ); you can stop your program at any time. For example:
           
cout  << “Enter a character” << endl ;
getch ( ) ;
cout << “Virtual University” ;

            In the above example your program will display

                                      Output


Enter a character
_
Virtual University

Notice that the program will stop after printing “Enter a character”. It will not proceed until you press a character from the keyboard and then press Enter. After you have pressed any key followed by Enter from the keyboard it will display “Virtual University”.

Note

          Dev-C++ does not support conio.h. So you have to include conio.c in your program as a header file.

Rational Numbers

Rational Numbers are very important in mathematical computing. The Rational Numbers is in the form numerator / denominator. The arithmetic operations can be performed in the following way:

o       Addition

If A and B are two Rational Numbers then
           
A + B = ((Numerator of A * Denominator of B) + (Numerator of B * Denominator of A))
              ------------------------------------------------------------------------------------------------------
((Denominator of A * Denominator of B)

o       Subtraction

If A and B are two Rational Numbers then
           
A - B = ((Numerator of A * Denominator of B) - (Numerator of B * Denominator of A))
              ------------------------------------------------------------------------------------------------------
((Denominator of A * Denominator of B)

o       Multiplication

If A and B are two Rational Numbers then
           
A * B =          (Numerator of A * Numerator of B)
  -------------------------------------------------------
     (Denominator of A * Denominator of B)

o       Division

If A and B are two Rational Numbers then
           
A / B =              (Numerator of A * Denominator of B)
       -------------------------------------------------------
(Denominator of A * Numerator of B)

Note

          Negative numbers in denominators are not allowed so if there is a negative sign in the denominator of the result during the Arithmetic operations then the numerator and denominator both are multiplied by -1. Also if there is a 0 in the denominator then it is not a valid Rational Number.

Assignment

Write a program that performs the above mentioned operations on rational numbers with the help of above mentioned formulae.

The program should have

·        Four user–defined functions for the operations
·        clrscr ( ) and getch ( ) functions for better user interaction

The program should check the criteria:

  • If the user enters a zero in the denominator / numerator then the program should display Zero is not allowed in the denominator” else the resultant rational number is displayed

  • If there is a 1 in the denominator the program should display only the numerator of the result else the resultant rational number is displayed but the numerator remains 1

  • If there is a 0 in the numerator then it should display a 0 else the resultant rational number is displayed and the denominator is also set to zero

  • If there is a negative number in the denominator then both the numerator and denominator should be multiplied by -1 and then displayed else the resultant rational number is displayed.


The following menu of commands should be displayed at the start of execution.

Press 'a' to add two Rational numbers

Press 's' to subtract two Rational numbers

Press 'm' to multiply two Rational numbers

Press 'd' to divide two Rational numbers

Press 'q' to quit

Please enter your choice:   a

After the user selects a choice, prompt the user to enter the numbers/values on which the selected mathematical operation is to be performed, and then display the result. For example, if the user presses ‘a’ then your output should be similar to:

Enter numerator: 14
Enter denominator: 12

The rational number is:         14 / 12

Enter numerator: 4
Enter denominator: 2

The rational number is:         4 / 2

The sum is 76 / 24.

Press any key to continue . . .

After the menu if the user selects ‘s’

Enter numerator: 1
Enter denominator: 0

Zero is not allowed in denominator

Enter the number again


Enter numerator: 11
Enter denominator: 13

The rational number is:         11 / 13

Enter numerator: 4
Enter denominator: 1

The rational number is:         4

The difference is. - 41 / 13

Press any key to continue . . .

The screen should be cleared when the user presses any key and the main menu should be displayed again.

Read the above specifications and:

a.      Write a C program to solve the problem based on your flow-chart

Submit ONLY the .cpp file as your assignment.