CMPE100_final_2021_fall.pdf - İstanbul Bilgi University...

This preview shows page 1 out of 1 page.

İstanbul Bilgi UniversityDepartment of Computer EngineeringCMPE 100: Introduction to Computing2020/2021 Fall-Final Exam (Duration: 80 minutes)1234TOTALIn each of the questions below write the function to produce the output according to problemstatement. Make sure to include cases in which program must produce an error. Also putdatadefinitions,contractandtest cases(i.e. check-expect tests/examples)in your programs. Youneed to add documentation comments only if you find them necessary to describe your approach.1. (20pts)Designand instantiate a structure which has2 fields: color (line color), positions(positions of a line).coloris represented by a stringandpositionsis represented by a listwhichhasonly2elements. Each element is aposn structurewith2 fields: x (x coordinate) and y (ycoordinate).xandyare represented by numbers. (Do not forget to write down the functions -constructors, selectors, and predicates. SolveQuestion 2,3by usingthat structureDistance of two points A(x1,y1) and B(x)
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags
Binary relation, Array data structure, Currying, Array data type, Istanbul Bilgi University

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture