Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
37 views
5 pages
CSC 201
Uploaded by
EICQ/00154/2020 SAMUEL MWANGI RUKWARO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save CSC 201 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
37 views
5 pages
CSC 201
Uploaded by
EICQ/00154/2020 SAMUEL MWANGI RUKWARO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save CSC 201 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save CSC 201 For Later
You are on page 1
/ 5
Search
Fullscreen
(University of Choice) MASINDE MULIRO UNIVERSITY OF SCIENCE AND TECHNOLOGY (MMUST) MAIN CAMPUS UNIVERSITY EXAMINATIONS SUPPLEMENTARY/SPECIAL EXAMS FOR THE DEGREE IN CIVIL AND STRUCTURAL ENGINEERING/ ELECTRICAL AND COMMUNICATION ENGINEERING/ MECHANICAL AND INDUSTRIAL ENGINEERING COURSE CODE: CSC 201 COURSE TITLE: COMPUTER PROGRAMMING I DATE: 29/07/2022 TIME: 8:00a.m-10:00a.m INSTRUCTIONS TO CANDIDATES Answer Question ONE (1) and any other TWO TIME: 2 Hours MMUST observes ZERO tolerance to examination cheating This Paper Consists of 5 Printed Pages. Please Turn Over.QUESTION ONE [30marks] a) Define the following terms: [4marks] i, Variable ii, assembler iii, loop iv. object code b) Outline rules followed when declaring variables in programing. [3Marks] ©) Explain any two limitations of low level languages. [2Marks} 4) What effects do comments have on a program? [2Marks} €) Mary, a student in MMUST wrote the following code during a programming session Hinclude
int main (); char ch="A’; char str[20]="fresh2refresh.com”; float flt=10.234; int no=150; double dbl=20.123456; printf(“character is %d \n",ch); printf(“string is %s \n" str); printf(“float value is %f \n”,flt); printi(“integer value is %ed \n",no); printi(“double value is %lf \n”,dbl); printf(“octal value is %o \n”.no); printf(“hexadecimal value is %x \n",n0); return 0; } Required: identify three errors in the above program, [3 marks] £) Explain each of the following terms as used in programming, [2Marks] i. scanf ii, return 0;2) Write a C program that uses a function to compute circumference of a circle. [4marks] hh) develop a flowchart that accepts marks scored by a student in three units; calculate the total marks and average marks. Depending on average marks the grades are assigned as follows: A=70- 100 B+60 - 69 C=50-59 D=40-49 Ee 1-39 [10Marks]QUESTION TWO [20marks] a) Using examples, explain FIVE major classifications of programming languages. [10 Marks} b) Using appropriate examples, describe any TWO unary operators used in C programming, [4Marks} ©) Describe any three preprocessor directives [3marks) 4) Write aC statement to evaluate the following equation, [3marks] Side=Va? +b? -2abCOS(x) QUESTION THREE [20marks] a) Write a program to display the following output using while loop. [Marks] 20 15 10 5 0 ) Write aC program that can be used to give an award depending on the average mark of a student using the criteria below [8 marks] ‘Average mark | Award >=80 Distinction 3-65 Credit >=50 Pass <0 Fail b) Briefly describe any two classifications of control structures. [4Marks] ©) Distinguish between the while and do while control structures, [2 marks}QUESTION FOUR [20marks] a) Write a C program to calculate the roots of a quadratic equation Use the quadratic formula b) Study the program below and answer the questions that follow: 1, Hinclude
2. Int main() 3. { 4. Inta,bye; 5. Printf(“enter value of a:"); 6. Scanf(“%d”,&a); 7. Printf(“enter value of b:”); 8. Scanf(“%d” 8b); 9. Printf(“enter value of c:”); 10, Seanf(“%d",&c) 11, Return 0; 12} Explain the function of line 2,4,5,6 and 11 c) Give three differences between compilers and interpreters. QUESTION FIVE [20marks] a) Define the term system development? b) What is a pointer? [12 marks] [5 marks] [3 marks] [2Marks} [2Marks] ©) Write a c program that uses a recursion to compute the factorial of a number which is entered by the user, [6 marks] d) Program control structures dictate the flow and execution of the program. Explain the following types of control structures. i. sequence ii, Selection iii, eration e) Using an illustration differentiate between local and global variables [Marks] [4 marks}
You might also like
Programming in C Sample Question Paper
PDF
80% (5)
Programming in C Sample Question Paper
5 pages
Sco417 - Gis Exam
PDF
67% (3)
Sco417 - Gis Exam
2 pages
Sample Question Paper of PRogramming in 'C'
PDF
100% (1)
Sample Question Paper of PRogramming in 'C'
4 pages
Ee171, UE Ex - 2015-1
PDF
No ratings yet
Ee171, UE Ex - 2015-1
3 pages
EE 171 UE 1st SEMESTER WITH ANS
PDF
No ratings yet
EE 171 UE 1st SEMESTER WITH ANS
6 pages
Sit106 Programming Methodology 2
PDF
No ratings yet
Sit106 Programming Methodology 2
3 pages
Sma 2175 Computer Programming 1 Exam (Paper Ii)
PDF
No ratings yet
Sma 2175 Computer Programming 1 Exam (Paper Ii)
2 pages
Programming Fundamentals
PDF
No ratings yet
Programming Fundamentals
6 pages
Sit 106 Programming Methodology 4
PDF
No ratings yet
Sit 106 Programming Methodology 4
3 pages
CIT-3102-past Paper
PDF
No ratings yet
CIT-3102-past Paper
2 pages
CSC2203 Aug 2015
PDF
No ratings yet
CSC2203 Aug 2015
6 pages
DIT 305 PROGRAMMING METHODOLOGY - July 2022 Exam Sat
PDF
No ratings yet
DIT 305 PROGRAMMING METHODOLOGY - July 2022 Exam Sat
7 pages
Section A: y Z y X
PDF
No ratings yet
Section A: y Z y X
5 pages
C Programming 2072
PDF
No ratings yet
C Programming 2072
2 pages
Allama Iqbal Open University, Islamabad Warning: (Department of Computer Science)
PDF
No ratings yet
Allama Iqbal Open University, Islamabad Warning: (Department of Computer Science)
5 pages
ICS 2102 Introduction To Computer Programming
PDF
No ratings yet
ICS 2102 Introduction To Computer Programming
3 pages
CS114 - Assignment1
PDF
No ratings yet
CS114 - Assignment1
2 pages
Structured Programing Module20001
PDF
No ratings yet
Structured Programing Module20001
4 pages
BIT 2123 Structured Programming
PDF
No ratings yet
BIT 2123 Structured Programming
3 pages
Introduction To Programming and Algorithms Dit 0202
PDF
No ratings yet
Introduction To Programming and Algorithms Dit 0202
3 pages
CCS 2101 Computer Programming 1 Question paperEEE& BED
PDF
No ratings yet
CCS 2101 Computer Programming 1 Question paperEEE& BED
5 pages
Marking Scheme Com121 2023and24 - 011353
PDF
No ratings yet
Marking Scheme Com121 2023and24 - 011353
27 pages
SPC 2107 Introduction To Computer Programming Year I Semester
PDF
No ratings yet
SPC 2107 Introduction To Computer Programming Year I Semester
4 pages
Computer - Programming I
PDF
No ratings yet
Computer - Programming I
3 pages
CIT 3102 Past Papers
PDF
No ratings yet
CIT 3102 Past Papers
5 pages
CCS 1203 Introduction To Computer Programming CAT
PDF
No ratings yet
CCS 1203 Introduction To Computer Programming CAT
2 pages
Bigbull Education Xii-Computer 2024-2025
PDF
No ratings yet
Bigbull Education Xii-Computer 2024-2025
3 pages
Programming Languages Fundamentals C Diploma
PDF
No ratings yet
Programming Languages Fundamentals C Diploma
3 pages
Foc Model I
PDF
No ratings yet
Foc Model I
2 pages
CBSE Class 11 Computer Science Sample Paper 2018
PDF
No ratings yet
CBSE Class 11 Computer Science Sample Paper 2018
6 pages
Problem Solving and Programming
PDF
No ratings yet
Problem Solving and Programming
25 pages
Pps Previous Papers
PDF
No ratings yet
Pps Previous Papers
8 pages
SMA 2175 Computer Programming I Exam
PDF
No ratings yet
SMA 2175 Computer Programming I Exam
3 pages
Consolidation Assignment
PDF
No ratings yet
Consolidation Assignment
2 pages
ITP-quesion Bank Set-I
PDF
No ratings yet
ITP-quesion Bank Set-I
8 pages
ICS 2102 Introduction To Computer Programming
PDF
No ratings yet
ICS 2102 Introduction To Computer Programming
3 pages
Computer Programming
PDF
No ratings yet
Computer Programming
21 pages
Important Questions For Board Exam
PDF
No ratings yet
Important Questions For Board Exam
11 pages
Allama Iqbal Open University, Islamabad (Department of Computer Science) Warning
PDF
No ratings yet
Allama Iqbal Open University, Islamabad (Department of Computer Science) Warning
4 pages
BSC 1 Sem Cs Programming in C 20321 e Nov 2021
PDF
No ratings yet
BSC 1 Sem Cs Programming in C 20321 e Nov 2021
6 pages
BCSC 1102 INTRODUCTION To PROGRAMMING - Department of Computing and Mathematics
PDF
No ratings yet
BCSC 1102 INTRODUCTION To PROGRAMMING - Department of Computing and Mathematics
4 pages
CSC442-Modular Programming-Exam-Apr2023
PDF
No ratings yet
CSC442-Modular Programming-Exam-Apr2023
4 pages
Intro To Programminng
PDF
No ratings yet
Intro To Programminng
2 pages
INTRODUCTION-TO-PROGRAMMING-JAN-2024 (WWW - Jntumaterials.co - In)
PDF
No ratings yet
INTRODUCTION-TO-PROGRAMMING-JAN-2024 (WWW - Jntumaterials.co - In)
8 pages
Question Bank
PDF
No ratings yet
Question Bank
3 pages
CIT 3102 Programming Supp Town
PDF
No ratings yet
CIT 3102 Programming Supp Town
2 pages
Intro Programming
PDF
No ratings yet
Intro Programming
3 pages
SPC 2101 Introduction To Computer Programming Concepts Year I Semester II
PDF
No ratings yet
SPC 2101 Introduction To Computer Programming Concepts Year I Semester II
2 pages
Adobe Scan 02 May 2022
PDF
No ratings yet
Adobe Scan 02 May 2022
5 pages
CIT 1203 - Structured Programming QP PRINT
PDF
No ratings yet
CIT 1203 - Structured Programming QP PRINT
2 pages
Full Test Paper 1
PDF
No ratings yet
Full Test Paper 1
3 pages
C++ Unit 1-Qb With Ans
PDF
No ratings yet
C++ Unit 1-Qb With Ans
22 pages
Final Model Paper Computer Science SSC-II
PDF
No ratings yet
Final Model Paper Computer Science SSC-II
7 pages
CP 1
PDF
No ratings yet
CP 1
2 pages
Kinap Student Guide and Declaration Form
PDF
No ratings yet
Kinap Student Guide and Declaration Form
14 pages
Cse 342
PDF
No ratings yet
Cse 342
4 pages
EECQ - 4242 - Lumped Flow Routing
PDF
No ratings yet
EECQ - 4242 - Lumped Flow Routing
13 pages
Data Analysis
PDF
No ratings yet
Data Analysis
6 pages
Research Methods 1
PDF
No ratings yet
Research Methods 1
2 pages
W.R. - Earth Dams and Spillways
PDF
No ratings yet
W.R. - Earth Dams and Spillways
20 pages
Cse 342 - Highway Geometric Design
PDF
No ratings yet
Cse 342 - Highway Geometric Design
3 pages
Lecture 1 Highway Geometric Design
PDF
No ratings yet
Lecture 1 Highway Geometric Design
9 pages
EECQ - 4242 - Probability in Hydrology
PDF
No ratings yet
EECQ - 4242 - Probability in Hydrology
13 pages
GROUP
PDF
No ratings yet
GROUP
7 pages
EECQ - 4242 - Systems Concept
PDF
No ratings yet
EECQ - 4242 - Systems Concept
5 pages
Bearing Capacity
PDF
No ratings yet
Bearing Capacity
18 pages
Cse 421 - Foundation Engineering
PDF
No ratings yet
Cse 421 - Foundation Engineering
4 pages
Dce 081 - Irrigation and Drainage Engineering
PDF
No ratings yet
Dce 081 - Irrigation and Drainage Engineering
3 pages
EECQ 4142 Surfacewater
PDF
No ratings yet
EECQ 4142 Surfacewater
24 pages
Retaining Walls
PDF
No ratings yet
Retaining Walls
20 pages
Cse 342
PDF
No ratings yet
Cse 342
4 pages
Eecq 4141 Tutorial Sheet 4
PDF
No ratings yet
Eecq 4141 Tutorial Sheet 4
2 pages
Spatial Interpolation Notes
PDF
100% (1)
Spatial Interpolation Notes
6 pages
Eecq 4141 Tutorial Sheet 1
PDF
No ratings yet
Eecq 4141 Tutorial Sheet 1
1 page
Introduction To Engineering Lesson3
PDF
No ratings yet
Introduction To Engineering Lesson3
7 pages
Eecq 4141 Tutorial Sheet 2
PDF
No ratings yet
Eecq 4141 Tutorial Sheet 2
2 pages
EECQ 4142 Soilwater
PDF
No ratings yet
EECQ 4142 Soilwater
13 pages
EECQ 4142 Precipitation
PDF
No ratings yet
EECQ 4142 Precipitation
23 pages
GGE 4203 Intro To GIS & Remote Sensing Exam - 2021
PDF
100% (1)
GGE 4203 Intro To GIS & Remote Sensing Exam - 2021
2 pages
Centrifugal Pump - Manometric Head 2
PDF
No ratings yet
Centrifugal Pump - Manometric Head 2
26 pages
7 - GGI - 4203-GIS and Remote Sensing
PDF
No ratings yet
7 - GGI - 4203-GIS and Remote Sensing
2 pages