Self-assessment test for programming prerequisites

Self-assessment test for programming prerequisites CISC 121 – Fall 2016

 To do well in CISC 121, you should have experience using basic elements of programming that occur in any language, including the following:

  • variables and assignment
  • simple input and output
  • condition statement (if)
  • loops
  • functions (also known as methods, procedures, or subprograms) with parameters and return values.

Attached is a list of five small programming tasks, which use the above-mentioned programming elements. To verify that you fulfill the required programming prerequisites for CISC 121, please take the time to implement these tasks. You can use any programming language. I strongly recommend that you not just read the task, but implement them. It will help you to truly identify your programming level and it is also much more fun.

If you have any questions or concerns regarding the test, please feel free to see me during my office hours. (See announcement on onQ site.)

  1. Task: Search in List

Given a list (or array) of n floating-point numbers, write a program which searches and outputs the largest number in the list.

  1. Task: Function isEven

Write a function isEven, which evaluates if a given integer number (given as a parameter for the function) is an even number. The function should return a Boolean value True if the number is even and False if the number is odd.

Given a list (or array) of n integer numbers, write a program which uses the function isEven to determines the number of even items in the list.

  1. Task: String and Loops

Write a function which takes a string (word) as an input parameter. The function should print the complete word on the first line and remove the last character on each successive line, ending with a single (the first) character.

Example:

Input word: Test

Function output:

Test

Tes

Te

T

  1. Task: Input

Write a program that prompts the user for a word, then prints the number of vowels this word contains. (For this purpose, vowels are a,e,i,o,u.)

  1. Task: Function, Method or Subprogram

In a right-angled triangle the length of the hypotenuse c and the length of the two remaining sides a and b define the angles of the triangle. Write a function (method) which takes the three side lengths of a right-angles triangle (a,b,c) as parameters and calculates the angles of the triangles.

Comments are closed.