Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301 Data Structures Assignment No 2 Fall Semester 5th November 2012
#1


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.
©. Call the Add() function with b_sum object to add and display the sum of both binary numbers.

Sample Output 1:

Sample Output 2:


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


0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,204 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,089 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,597 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,279 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,869 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,099 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,909 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,531 05-20-2015, 01:34 AM
Last Post: Xpert
  PHY301 Circuit Theory Assignment No. 1 idea Solution spring may 2015 semester Xpert 0 1,558 05-15-2015, 03:52 AM
Last Post: Xpert
  Assignment No. 01 Spring 2015 Information Systems CS507 idea solution spring 2015 Xpert 0 2,447 05-15-2015, 03:49 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)