question archive THE COPPERBELT UNIVERSITY KAPASA MAKASA UNIVERSITY CAMPUS DEPARTMENT OF ICT ICT 250 DATA STRUCTURES, ALGORITHMS AND PROGRAMMING (PROGRAMMING C++) 2022 Assignment INSTRUCTIONS • There are questions in the assignment, answer them all

THE COPPERBELT UNIVERSITY KAPASA MAKASA UNIVERSITY CAMPUS DEPARTMENT OF ICT ICT 250 DATA STRUCTURES, ALGORITHMS AND PROGRAMMING (PROGRAMMING C++) 2022 Assignment INSTRUCTIONS • There are questions in the assignment, answer them all

Subject:Computer SciencePrice: Bought3

THE COPPERBELT UNIVERSITY KAPASA MAKASA UNIVERSITY CAMPUS DEPARTMENT OF ICT ICT 250 DATA STRUCTURES, ALGORITHMS AND PROGRAMMING (PROGRAMMING C++) 2022 Assignment INSTRUCTIONS • There are questions in the assignment, answer them all. • Assignments must be submitted according to the due date. Late submissions will not be received. • All assignments to be submitted to the lecturer, in both hard and soft copy. • Use the APA style for referencing. • The work must be typed, not exceeding 6 pages, excluding the page for references and the cover. Edit your work before printing. • All typed work must be in “times new roman”, font 12 and a spacing of 1.25. • Attention must be given to proper usage of English and logical presentation of points and paragraphing. Give examples where possible, and use diagrams to support your facts • Use of sub-headings is encouraged. • Answer the assignments with citations. • All the hardcopy assignments must be in single folder that the class will organize. • The submissions will be checked using Plagiarism Checker X 2018 Professional, for peer to peer copying and duplication, and work that will score more than 70% on the duplication scale will be penalized. __________________________________________________________________ Course Lecturer: Mr. J.K. Pelekamoyo Assignment Due date: TO BE COMMUNICATED Question 1 You have been contracted by Toyota Zambia to design a system that can make the Toyota Mark X a smart vehicle. The company has proposed to install four infrared radars on the car, just below each light set, to use as sensors. Each sensor has a range of 20m. The company wants the car to be able to avoid collisions at the rear, and the front, and to be able to auto accelerate to a recommended spend if the course is clear or when collision is eminent at the rare and the front is clear, and to be able to overtake a vehicle on the road without causing any accident. The sensors can pick human body heat at a distance of 15m, and a vehicle body heat at 20m. a. Using a pseudocode, show the algorithm for the car system, an remember that it is using four sensors, one at each vehicle corner. With swaying to the right if the left is not clear and vice versa, till it stops or it continues to correct its paths if the course is clear. b. Using C++, write a source code for the car smart system (Please, make the code as simple as possible by using control statements and conditionals. And your source should not spin more than a page). Question 2 a. The following program segment is an attempt to compute the quotient (forgetting any remainder) of two positive integers (a dividend and a divisor) by counting the number of times the divisor can be subtracted from the dividend before what is left becomes less than the divisor. For instance, 7⁄3 should produce 2 because 3 can be subtracted from 7 twice. Is the program correct? Justify your answer. Count ← 0; Remainder ← Dividend; repeat (Remainder ← Remainder – Divisor; Count ← Count + 1) until (Remainder < Divisor) Quotient ← Count. b. The following algorithm is designed to print the beginning of what is known as the Fibonacci sequence. Identify the body of the loop. Where is the initialization step for the loop control? The modification step? The test step? What list of numbers is produced? Last ← 0; Current ← 1; while (Current < 100) do (print the value assigned to Current; Temp ← Last; Last ← Current; and Current ← Last + Temp) Question 3 Describe a tree structure that can be used to store the genealogical history of a family. What operations are performed on the tree? If the tree is implemented as a linked structure, what pointers should be associated with each node? Design procedures to perform the operations you identified above, assuming that the tree is implemented as a linked structure with the pointers you just described. Using your storage system, explain how one could find all the siblings of a person. Question 4: Chess Game Knight’s travails. Develop a data structure similar to a binary tree. Using a standard 8 X 8 chessboard, show the knight’s movements in a game. As you may know, a knight’s basic move in chess is two forward steps and one sidestep. Facing in any direction and given enough turns, it can move from any square on the board to any other square. If you want to know the simplest way your knight can move from one square (or node) to another in a two-dimensional setup, you will first have to build a function like the one below. knight plays ([0,0], [1,2]) == [[0,0], [1,2]] knight plays ([0,0], [3,3]) == [[0,0], [1,2], [3,3]] knight plays ([3,3], [0,0]) == [[3,3], [1,2], [0,0]] You are required to do the following: 1. Explain how you can ensure that any move do not go off the board. 2. Choosing a search algorithm for finding the shortest path for the knight’s travails. 3. Defend your choice of an appropriate search algorithm to find the best possible move from the starting square to the ending square. 4. Creating a script for a board game and a knight. 5. Create a diagrammatical tree structure, to illustrate all possible moves of the knight as children in the tree structure. In this task, you need to understand two algorithms which can be helpful, the Breadth-First Search which utilizes the Queue data structure to find the shortest path and the Depth-First Search which can traverse a Stack data structures.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions