Write procedures to manipulate queues

Assignment Help Software Engineering
Reference no: EM13317086

Question 1

Submit your answer to this question as a PDF (Question1.pdf).

Part 1

Download Question1.rkt and draw an environment diagram representing the code within. Marks will be distributed as follows:

? Global definitions are correct
? All necessary frames are present
? All frames are arranged correctly (i.e. properly nested, etc)
? Definitions within the non-global frames are correct
? All code being called in the global frame and as the bodies of functions is represented correctly

Part 2

Explain what the lines
(point getx)
(point gety)

will display, and why, ensuring you trace through the environment diagram and as you explain.

Code Style and Testing

Refer to the below and the general "Assignment Do's and Don'ts" doc linked to on cuLearn.

? All code has been well indented and has been broken down into reasonably sized procedures (no single line should be too long; aim for about 80 characters each)
? Each procedure has been well documented (but not over-documented - don't just restate the code) with comments, including the purpose of the procedure, the expected inputs, and the expected output
? There is sufficient testing using check-expect and, at a minimum, no code is highlighted by DrRacket when the file is run

Question 2
An accumulator is a procedure that is called repeatedly with a single numeric argument and accumulates its arguments into a sum. Each time it is called, it returns the currently accumulated sum. Write a procedure make-accumulator that generates accumulators, each maintaining an independent sum . The input to make-accumulator will correctly specify the initial value of the sum; for example
(define A (make-accumulator 5))
(A 10)
15
(A 10)
25

Question 3

Write a procedure (make-queue) that produces independent first-in-first-out queue objects, using a message-passing style . For example:
(define queue1 (make-queue))
(define queue2 (make-queue))

Write procedures to manipulate queues. At a minimum:
1. (queue1 'empty?): boolean
2. (queue1 'enqueue! item): adds item to the queue
3. (queue1 'front): returns the next element of the queue that would be removed on dequeue
4. (queue1 'back): returns the last element of the queue that would be removed on dequeue (i.e. the most recent element added)
5. (queue1 'dequeue!): throws away the front element
6. (queue1 'print): prints some representation of the queue from front to back


Attachment:- ASSIGNMENT.rar

Reference no: EM13317086

Questions Cloud

What is the final temperature of the mixture : A 65-g ice cube at 0°C is placed in 665 g of water at 30°C. What is the final temperature of the mixture
What is meant by router interfaces with ssh listening : What is meant by router interfaces with ssh listening on the internet.
Determine the internal loads acting along the z-directions : The sign is attached to the post that is built-in at the ground. Treat the sign as having uniform mass. Neglect the contribution of the post weight. The length d is from the center plane of the sign to the center of the post.
Find the emf induced across its wing : An airplane of wing span 40.0 m flying horizontally at a speed of 774 km/h due north in a region where the vertical component of the earth's magnetic field is 4.75 *10^-5 T. Find the emf induced across its wing
Write procedures to manipulate queues : An accumulator is a procedure that is called repeatedly with a single numeric argument and accumulates its arguments into a sum. Each time it is called, it returns the currently accumulated sum. Write a procedure make-accumulator that generates ac..
At what rate is energy being removed : A 300-g aluminum cup contains 1000 g of water in thermal equilibrium with the cup at 65°C. At what rate is energy being removed
What is the carnot efficiency : A Carnot heat engine takes 2000J of heat from the high temperature reservoir at 227 degrees Celsius, What is the Carnot efficiency
What is the focal length of the second lens : Object O1 is 14.5 cm to the left of a converging lens with a 12.0-cm focal length. What is the focal length of the second lens
What is the flux through the flat base : A closed surface is formed from a 3.5-cm radius hemisphere ‘capped' by a flat base. what is the flux (in N m^2/C) through the flat base

Reviews

Write a Review

Software Engineering Questions & Answers

  How jane should deal with the two system analysts

Describe how Jane should deal with the two system analysts from a technical and human resource perspective and explain the factors that Jane should consider in establishing a process management solution.

  How project visualization maps to architectural views

Choose one of the agile software development methodologies/processes and explain how changes can be managed in software development projects. Describe how project visualization maps to architectural views.

  Example of a business related report

Recognize an example of a business related report created with MS Excel. Attach a sample of the report in an Microsoft Excel file.

  What would you consider some of the key considerations

Explain your choices. Is the organization you work for (or one that you are familiar with) meeting these key considerations?

  Develop an activity diagram for the use case

Develop an Activity Diagram for the use case chosen in part A and develop a System Sequence Diagram (SSD) for the complete overall system and a Sequence Diagram (SD) for your selected use case.

  Design context diagram for entering user-s name in system

Design Context diagram, level0 and level1 (if need) for the following: The user submit her/his name to the system, the system will tell the user if he is a boy or a girl or don't know by looking up his name in database

  Explain the syntax of programming languages

BNF is used extensively in the computing field to describe the syntax of programming languages. Give an example of where and how BNF might be used to solve real-world problems

  Sketch the e-r diagram for university

Sketch the E-R diagram for each of the following situations (if you believe which you need to make extra assumptions, clearly define them for each situation).

  Introduction to the theory of computation

The language define through the equality of two 2DIM-DFA machines on all inputs is un-decidable. The full definition of 2DIM-DFA can be discovered in Sipser's Introduction to the Theory of Computation.

  Design user-s requirements specification for school

Design a user's requirements specification for the EasyDrive School of Motoring database system. Use a single major user view for the application (Director View)

  Describe the primary sdlc methodologies

The System Development Life Cycle has constructed over the decades to include a variety of Methodologies. Each of these Methodologies utilizes same processes in a different way.

  Sketch the flowchart for user to enter credit card balance

Sketch the flowchart or write pseudocode for the application which permits user to enter credit card balance. suppose the interest rate is 1 percent per month

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd