Section A Question 1 Stacks are a particular way of storing and editing data in memory, explain the rationale behind the use of stack pointers. Draw a flow chat to demonstrate how data would be pushed onto stack Write a pseudo code to push data into a stack Using your code in “c” write a program using c++ programming language to data into the stack   Question 2 Assuming you are to add three numbers. Write an algorithm to perform additions   Such a specification creates difficulty, while actually implementing it (difficulty in converting into source code). Hence many programmers prefer to have specification of algorithm by means of pseudo-code. Another way of representing the algorithm is by flow chart. Flow chart is a graphical   Convert your algorithm in “a” above into a c++ program   Critically explain how your algorithm in “a” would be modified to sum n numbers Determine the space complexity of your algorithm in “b” above   Question 3 Arrays and linked list are a way of storing data in computers. Critically explain why you will choose one over the other if you are to insert and delete data. If int [7] is used to store data in a standard computer, determine the size of memory that will be needed to store the data and explain how you got that answer Assuming 4 of the memory reserved in the declaration in “b” above was used, determine in bytes, the memory used and explain why A bi-dimensional array float call[3][2]={4,1,0,3} is used to store information arriving at a call center. If call[2][1] is to be analyzed, determine the information stored there and explain how you got your answer..     Section B Question 1 The electoral petition of 2021 was aimed at determining the winner of the 2020 election. The rule is that the winner of an election in Ghana must obtain at least 50% + 1 of the valid votes cast. Draw a flow chat for the scenario described above Using your flow chat in “a” above, write an algorithm that could be implemented using any programming language. Your algorithm should be able to declare a winner if he/she meets the condition of 50% + 1. Critically explain how you will store data for the presidential candidates and the valid votes cast for them. If two variables are stored as integers and manipulated such that one divides the other and the results stored. Explain how you would prevent the loss of fractional parts after the division     Question 2 If data in a warehouse are stored in a stack architecture and it has been agreed by management that data has to be removed from the stack, discuss giving reasons the first action you will take in removing the data Draw a flow chat to demonstrate how data will be removed from stack. Write a pseudo code for the process in “b” above. Using your code in “c” above, write a program using either C or C++ programming language to remove data from the stack.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Section A

Question 1

  1. Stacks are a particular way of storing and editing data in memory, explain the rationale behind the use of stack pointers.
  2. Draw a flow chat to demonstrate how data would be pushed onto stack
  3. Write a pseudo code to push data into a stack
  4. Using your code in “c” write a program using c++ programming language to data into the stack

 

Question 2

Assuming you are to add three numbers.

  1. Write an algorithm to perform additions

 

Such a specification creates difficulty, while actually implementing it (difficulty in converting into source code). Hence many programmers prefer to have specification of algorithm by means of pseudo-code. Another way of representing the algorithm is by flow chart. Flow chart is a graphical

 

  1. Convert your algorithm in “a” above into a c++ program

 

  1. Critically explain how your algorithm in “a” would be modified to sum n numbers
  2. Determine the space complexity of your algorithm in “b” above

 

Question 3

  1. Arrays and linked list are a way of storing data in computers. Critically explain why you will choose one over the other if you are to insert and delete data.
  2. If int [7] is used to store data in a standard computer, determine the size of memory that will be needed to store the data and explain how you got that answer
  3. Assuming 4 of the memory reserved in the declaration in “b” above was used, determine in bytes, the memory used and explain why
  4. A bi-dimensional array float call[3][2]={4,1,0,3} is used to store information arriving at a call center. If call[2][1] is to be analyzed, determine the information stored there and explain how you got your answer..

 

 

Section B

Question 1

The electoral petition of 2021 was aimed at determining the winner of the 2020 election. The rule is that the winner of an election in Ghana must obtain at least 50% + 1 of the valid votes cast.

  1. Draw a flow chat for the scenario described above
  2. Using your flow chat in “a” above, write an algorithm that could be implemented using any programming language. Your algorithm should be able to declare a winner if he/she meets the condition of 50% + 1.
  3. Critically explain how you will store data for the presidential candidates and the valid votes cast for them.
  4. If two variables are stored as integers and manipulated such that one divides the other and the results stored. Explain how you would prevent the loss of fractional parts after the division

 

 

Question 2

  1. If data in a warehouse are stored in a stack architecture and it has been agreed by management that data has to be removed from the stack, discuss giving reasons the first action you will take in removing the data
  2. Draw a flow chat to demonstrate how data will be removed from stack.
  3. Write a pseudo code for the process in “b” above.
  4. Using your code in “c” above, write a program using either C or C++ programming language to remove data from the stack.

 

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education