Sponsored Links


Results 1 to 1 of 1

Thread: CS301 Data Structures Assignment No 2 Fall Semester 5th November 2012

  1. #1
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578

    18 CS301 Data Structures Assignment No 2 Fall Semester 5th November 2012

    Sponsored Links1




    After the cancellation of Assignment 1 now. New Assignment 2 has been uploaded.


    CS301 Data Structures Assignment No 2 Fall Semester 5th November 2012


    Assignment No. 02
    SEMESTER Fall 2012
    CS301- Data Structures
    Total Marks: 20

    Due Date: 07/11/2012
    Instructions
    Please read the following instructions carefully before solving & submitting assignment:
    It should be clear that your assignment will not get any credit (zero marks) if:
    o The assignment is submitted after due date.
    o The submitted code does NOT compile.
    o The submitted assignment is other than .CPP file.
    o The submitted assignment does NOT open or file is corrupted.
    o The assignment is copied (from other student or ditto copy from handouts or internet).
    Uploading instructions
    For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file.

    Note: Use ONLY Dev-C++ IDE.
    Objective
    The objective of this assignment is

    To make you familiar Programming with the Stack data structure.



    GOOD LUCK
    Marks: 20
    In digital computers, bit patterns are used to represent many types of data. Computers perform various operations on bit patterns. With a good representation scheme, bit patterns represent data and bit pattern manipulations represent operations on data. An important example of this is the Binary Addition Algorithm, where two bit patterns representing two integers, which are manipulated to create a third pattern which represents the sum of the integers.
    Most processor chips implement the Binary Addition Algorithm in its silicon as part of their arithmetic logic unit.
    Write a program in C++ which asks user to enter two binary numbers. Store these two numbers in two different stack variables (objects) bit by bit and calculate its sum and store it in another stack variable and display its sum.


    Solution Guidelines:

    1. Create a class named Bin_add (means stack class) that should contain following inline functions:
    • Constructor( ): To initialize “Bin_add” class data members.
    • Isempty( ): To check whether a stack is empty or not.
    • Push( ) To push binary number bit by bit onto the stack
    • Pop( ) To pop bit (either 0 or 1) from the top of the stack
    • Add( ) To add two binary numbers bit by bit and display the sum.

    2. In main function:
    (a). Create three objects b1, b2, b_sum of type Bin_add class, two for input and one for storing the sum.
    (b). Read two binary numbers from user bit by bit and push (insert) them in b1 and b2.
    (c). Call the Add() function with b_sum object to add and display the sum of both binary numbers.

    Sample Output 1:

    Sample Output 2:


    Sponsored Links

    Lectures Covered: This assignment covers Lecture # 1-8
    Deadline: Your assignment must be uploaded/submitted at or before, November 07,2012

    Last edited by Vuhelper; 11-05-2012 at 04:11 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-28-2013, 02:46 PM
  2. Replies: 0
    Last Post: 11-14-2012, 02:11 PM
  3. Replies: 4
    Last Post: 01-23-2012, 08:14 PM
  4. Replies: 0
    Last Post: 12-22-2011, 02:18 AM
  5. Replies: 9
    Last Post: 11-19-2011, 04:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft