Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

BASIC Programming Exam for Electronic Engineering Students at Cork Institute of Technology, Exams of Computer Science

A past exam paper for the basic programming course for students enrolled in the bachelor of engineering programs in electronic automation and robotics, applied electronics design, and communications systems at cork institute of technology. The exam covers various topics such as functions, variables, constants, loops, spreadsheet formulas, and basic programming concepts. Students are required to answer questions related to these topics and write simple basic programs.

Typology: Exams

2012/2013

Uploaded on 03/30/2013

lalchand
lalchand 🇮🇳

4.4

(67)

95 documents

1 / 3

Toggle sidebar

Related documents


Partial preview of the text

Download BASIC Programming Exam for Electronic Engineering Students at Cork Institute of Technology and more Exams Computer Science in PDF only on Docsity! Cork Institute of Technology Bachelor of Engineering in Electronic Automation and Robotics – Stage 1 Bachelor of Engineering in Applied Electronics Design – Stage 1 Bachelor of Engineering in Communications Systems – Stage 1 (NFQ Level 7) Autumn 2007 Computing (Time: 3 Hours) Answer any four questions Maximum available marks is 100. Examiners: Mr. P Cogan Mr. D. Denieffe Dr. R. Dubhghaill Q1. (a) Write a note discussing how each of the following relates to the BASIC programming language; (i) Functions (ii) Variables. (iii) Constants. (iv) Loops. [8 marks] (b) Explain each line of the following program, draw the program’s output and describe what happens if the number 4 is entered. [10 marks] DIM N, T, L AS INTEGER CLS PRINT INPUT "Enter a positive integer", N T = 1 FOR L = 1 TO N T = T * L NEXT L PRINT “Original value = “;N; PRINT " and the result is "; T PRINT END (c) Write a simple BASIC program that reads in the destination names and costs of two holidays. The program should then report on which holiday is the cheapest and the price difference between the holidays. [7 marks] (25 Marks in total) continued overleaf …. 2 Q2. (a) Cells B5 to B8 on a spreadsheet contain a list of numbers in ascending order. Write down and explain the formulae that you would place in a cell to; (i) add up the numbers (ii) get the average of the numbers (iii) find the number closest to but not exceeding 12.51 [7 marks] (b) Write a BASIC program that reads in an exam mark and grades it as follows; 0 to 30 = F 30 to 40 = E 40 to 50 = Pass 50 to 60 = Merit 2 60 to 70 = Merit 1 70 or above = Distinction [6 marks] (c) Write a BASIC program that simulates a fortune-teller. It should read in a question from the user and then generate a random number between 1 and 5. Based on this random number it should display one of the following messages. [12 marks] Random Number Message 1 Yes, definitely 2 Ask again, later 3 No way! 4 It is certain. 5 Yes (25 Marks in total) Q3. (a) Give the syntax and an example of the count controlled loop structure. Draw a flowchart to illustrate your answer. [4 marks] (b) Give the syntax of the following two BASIC statements: (i) FOR … NEXT (ii) SELECT … CASE [4 marks] (c) Briefly distinguish between post-test loops and pre-test loops. [2 marks] (d) Write a program, using NESTED FOR LOOPS, which produces the following output: * ** *** **** [5 marks] (e) Write a program that will sum a list of positive integers entered by the user, terminating when the user enters a zero. Any negative numbers entered should be ignored. [10 marks] (25 Marks in total) continued overleaf ….
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved