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

  Research report on software design

Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.

  A case study in c to java conversion and extensibility

A Case Study in C to Java Conversion and Extensibility

  Create a structural model

Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.

  Write an report on a significant software security

Write an report on a significant software security

  Development of a small software system

Analysis, design and development of a small software system.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Create a complete limited entry decision table

Create a complete limited entry decision table

  Explain flow boundaries map

Explain flow boundaries map the dfd into a software architecture using transform mapping.

  Frame diagrams

Prepare a frame diagram for the software systems.

  Identified systems and elements of the sap system

Identify computing devices, which could be used to support Your Improved Process

  Design a wireframe prototype

Design a wireframe prototype to meet the needs of the personas and requirements.

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

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