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)
11 views
Programming Techq Past Question
Programming
Uploaded by
Ron Dany
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save programming Techq past question For Later
Download
Save
Save programming Techq past question For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
11 views
Programming Techq Past Question
Programming
Uploaded by
Ron Dany
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save programming Techq past question For Later
Carousel Previous
Carousel Next
Save
Save programming Techq past question For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
SEPTEMBER, 2019 Candidate's index Number | CSC 102SW PROGRAMMING TECHNIQUES 2 HOURS Signature: UNIVERSITY OF CAPE COAST COLLEGE OF EDUCATION STUDIES SCHOOL OF EDUCATIONAL DEVELOPMENT AND OUTREACH INSTITUTE OF EDUCATION COLLEGES OF EDUCATION FIVE-SEMESTER BACHELOR OF EDUCATION (SANDWICH) PROGRAMME FIRST YEAR, END-OF-FIRST SEMESTER EXAMINATIONS, SEPTEMBER 2019 SEPTEMBER 4, 2019 PROGRAMMING TECHNIQUES 2:30 PM — 4:00 PM SECTION B Answer ANY FOUR (4) questions. 1. Using if-else/if-statements, write a short program in pseudocode that declares an integer variable called Number, input Number, then display "Yes" if Number == 1, display "No" if Number == 2, and display "Maybe" if Number Kwamina and Esi have decided to spend their free Saturday to go to the movies. Their mother insists that they pick a 13-rated movie. Each time they suggest a movie title, she asks them if it is 13-rated. If the answer is NO, they must go back to the list of movies and pick another one. If the answer is VBS, they can go to the movies. Use the case above to construct a Flowchart 3. Construct a flowchart for this program that reflects the following tasks: If(PayRate < 10) AND (Hours > 40) then Set OvertimeHours = Hours ~ 40 Set OvertimePay = OvertimeHours * 1.5 * PayRate Set TotalPay ~ 40 * PayRate + OvertimePay Else Set TotalPay ~ Hours * PayRate End If Page 1 of 24 A. Distinguish between sy B. What will be the output o 10, 8, 3, 2,1 1 Declare Score As Integer 2 Declare Grade As Character 3 Write “Enter Scor: 4. Input Score 5. Select case of Score 6 Case 10 7 Set Grade = "A" 8 Break 9 Case 9 10 Case 8 11. Set Grade="B" 12 Break 13 Case 6 14 Case 7, 15 Set Grade = "C” 16 Break 17 Case 5 18 Case 4 19 Case 3 20 Set Grade="D" 21 Break 22 Case 2 23 Case | 24 Set Grade="E" 25 Break 26 End Case 27 Write “Student Had Grade”+ Grade mntax errors and logic errors. f the code below if a user enters the following number scores: 5. Carefully study the code snippets below and give its output (a) 1 Declare Count As Integer 2 Write "Hello World" 3 For (Count = 5; Count < 4; Count++) 4 Write "Help me please, I'm a prisoner in a For loop!" 5 End For 6 Write "Goodbye" (b) 1 Declare Count As Integer 2 Declare Beans as Integer 3 Set Beans = 4 4 For (Count = 1; Count <= Beans; Count++) 5 Write "You are welcome to UCC programming "+ Count + “class 6 End For Page 2 of 2=) Candidate’s Index Number SEPTEMBER 2019 CSC102SW PROGRAMMING TECHNIQUES 'Stenatura 1 HOUR Lo UNIVERSITY OF CAPE COAST COLLEGE OF EDUCATION STUDIES SCHOOL OF EDUCATIONAL DEVELOPMENT AND OUTREACH INSTITUTE OF EDUCATION FIVE-SEMESTER BACHELOR OF EDUCATION (SANDWICH) PROGRAMME, FIRST YEAR, FIRST SEMESTER QUIZ I, AUGUST 2019 SEPTEMBER 1, 2019 PROGRAMMING TECHNIQUES 1:30 AM — 2:30 AM. Answer all the questions For items 1 to 20, each stem is followed by four options lettered A to D. Read each statement carefully and circle the letter that corresponds to the correct or best option. 1. The program development cycle consists of all the following except ..... A. creating flowchart B. problem analysis C. program coding and debugging it D. program design Which of the following is not a basic control structure? A. The decision structure B. The loop structure C. The process structure D. The sequential structure we Which of the following is not classified as a decision/selection structure statement? A. If-else statement B. If-statement C. Select-case statement D. While-loop statement 4, Flowcharts use special symbols to display pictorially the flow of execution within a program. ‘Symbols used describe all the following except A. decision B. formula C. process D. starvend Page 1 of 45. What will be displayed when the variable Number = -1? If Number <0 Then Write "1" Else End if All B. 2 G3 D. Syntax Error 6. Algorithms can be expressed in all the following ways except .. A. arithmetic equations B. flowcharts C. pseudocode D. words 7. What is displayed when the following program segment is run? A=2,8=4 If (A == 2) AND (8 == 3) Then Write “Statement is true” End if A. “Statement is false” B. “Statement is true” C. Nothing is displayed D. True . Which of the following loop structures is used to repeat a section of code for an unknown number of times until a specific condition is met? A. For loop B. If-else statement C. Infinite loop D. While loop Which of the following expressions will evaluate to true when score = 45? A. score <= 60 AND score <= 100 B. score <= 60 OR score >= 100 C. score >= 60 AND score <= 100 D. score >= 60 OR score >= 100 The following are types of loop structures except A. Do-while loop B. For loop C. If-statement D. While loop Page 2 of 41 phe tak of hall wt thee eninge proryran, sensed ps 1 pl faye te pi, Meas Sin wise, spynepaiy St AE ws A compilation i dehnuulny 1 dep haainent eo WT it CL ie Le ee) r 1 dee tared © Initiglized 1) tinned 14 What will be Mopalnyeed iD Uae Ae beter i eae” 1 int A Declare number £5 Wheger 1, COW number © 1, number - Y epee) A Display Wella Wok 4. tnd Loop 6 td A. Hello Helle VW Hello Number © Helle World 1). Helle World 14. In the expronsion (2 4 4)/4 9 (4 1) whim pron wilh crept Cae At ne c° DT 15. All the following are valid identificrs exams A. dollar B. total ©. total number D. value 4 16. A loop that exists invide the body of aewhtaer lorry io caliee ‘A, do while loop B. inside loop C. nested loop D. while loop 17. Which of the following, is used to determine ter Aes Ge otrucion amie 2 om a executed? A. constant B. counter variable C. float D. identifier Pew bas18. A loop that repeats endlessly because it has no terminating condition is called a(n) A. do while loop B. infinite loop C. nested loop D. while loop 19. What will be displayed if the code below is run? firstNumber = 2, secondNumber = 4 1. Start 2. Declare firstNumber, secondNumber, Average As Integer 3. Display “Prompt user to enter two numbers” 4. Input firstNumber, secondNumber 5. Average = (firstNumber + secondNumber)/2 6. Disploy Average 7.End pop> mas a 0. What will be the output of the following pseudo code? Input f=6,9=9 and set sum=0 Integer n iflo>f) for(n=f:n
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6135)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brene Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (935)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8215)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2923)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4973)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Toibin
3.5/5 (2061)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1988)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2641)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1994)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2544)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
DPLC Home Economics
PDF
No ratings yet
DPLC Home Economics
94 pages
Gov't 24weeks Learning Plan
PDF
No ratings yet
Gov't 24weeks Learning Plan
112 pages
Exam Grading For JHS
PDF
No ratings yet
Exam Grading For JHS
39 pages
Coordinators Handbook 2
PDF
No ratings yet
Coordinators Handbook 2
236 pages
PLC Presentation
PDF
No ratings yet
PLC Presentation
75 pages
Microsoft Word 2013 GREAT
PDF
No ratings yet
Microsoft Word 2013 GREAT
38 pages
Word Processor
PDF
No ratings yet
Word Processor
19 pages
Ict Jhs 2 Term 1 Lesson Plan Draft 2018
PDF
No ratings yet
Ict Jhs 2 Term 1 Lesson Plan Draft 2018
16 pages
Introduction-to-Word - RONDANY BETTER
PDF
No ratings yet
Introduction-to-Word - RONDANY BETTER
13 pages
Paper 1 Science
PDF
No ratings yet
Paper 1 Science
7 pages
BS 7 Maths
PDF
No ratings yet
BS 7 Maths
5 pages
1.1.8 Programming Terminologies
PDF
No ratings yet
1.1.8 Programming Terminologies
7 pages
Ict - Super Mock
PDF
100% (1)
Ict - Super Mock
8 pages
English - SUPER MOCK
PDF
No ratings yet
English - SUPER MOCK
8 pages
ENGLISH
PDF
No ratings yet
ENGLISH
5 pages
Paper 2: Second Mock Examination (2023) (Objectives and Theory)
PDF
No ratings yet
Paper 2: Second Mock Examination (2023) (Objectives and Theory)
4 pages
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)