CA2024Proposed solution included

CSC 208 PROGRAMMING IN PYTHON AND C CA 2024

About this paper

CSC 208: Second Semester Test 1, 10/05/2024, University of Buea, Faculty of Science, Dept of Computer Science (source scan paginated 1-of-3/2-of-3 -- the third physical page is missing from the scan and is explicitly flagged, not fabricated): Section A (5 short C-concept answers, a C program printing all integers strictly between two user-entered numbers with optional swap, 4 code traces including a genuine infinite print loop); Section B, a Stanford-style Karel-robot TripleKarel painting problem, solved as general reusable pseudocode with an explicitly placeholder repositioning step since the exact building coordinates were on the missing page.

Open in Shoracy

Opens this paper in the app on your phone.

University of Buea

Faculty of Science - FS

Computer Science - CSC

CSC2082024

PROGRAMMING IN PYTHON AND C

CA · Second Semester · Level 200

From this paper

  1. 2.

    Write a C program which gets two integer numbers from the user, and displays all numbers in the range, excluding the numbers themselves. If the second number entered is bigger than the first, the numbers are swapped first. For example, if 10 and 4 are entered, the output will be: 5,6,7,8,9. If 2 and 8 are entered, the output will be: 3,4,5,6,7.

  2. 2.

    Next, Karel should accomplish the task of painting a single rectangle. Think about how you can use the functionality of the previous subtask to help you accomplish this goal. You may need to write a small amount of code to reposition Karel in between painting individual walls of a building.

Open in the app to read the full paper and its proposed solution.

View solutionOpen in Shoracy

At a glance

Course code
CSC208 (CSC 208)
Type
CA
Year
2024
Level
Level 200
Semester
Second Semester
Proposed solution
Included

Read CSC208 2024 in Shoracy.

  • Every page, with zoom for diagrams and small print
  • The proposed solution, one tap away
  • Stays on your phone after the first open, even offline
Open in Shoracy