C Programming Exam Guide | Generated by AI

Home 2026.02

“Computer Programming Fundamentals (Practice)” Course Examination Outline

Course Code: 13794


I. Assessment Objectives

This course aims to cultivate students’ computational thinking and programming skills, laying a solid programming foundation for subsequent specialized courses (such as “Advanced Programming Language” and “Data Structures”).

Specific assessment objectives:


II. Reference Textbook

“Computer Programming Fundamentals”
Edited by Sun Jianzhi, Xiao Yuanyuan, and Zhang Yingxin
Mechanical Industry Press, 2024 edition


III. Assessment Content

The assessment content focuses on core knowledge points with practical significance that can be verified through hands-on operations, specifically divided into 6 modules:

1. Data Types, Operators, and Input/Output

(1) Basic data types:

(2) Constants and variables:

(3) Operators and expressions:

(4) Input/output:

2. Structured Programming

(1) Conditional statements:

(2) Loop statements:

(3) Jump statements:

(4) Compound structures:

3. Arrays and Strings

(1) One-dimensional arrays:

(2) Two-dimensional arrays:

(3) Strings:

4. Function Basics

(1) Function definition and declaration:

(2) Function calls:

(3) Variable scope:

(4) Simple function implementation:

5. Pointer Basics

(1) Pointer definition and initialization:

(2) Pointers and arrays:

(3) Pointers and variables:

(4) Pointer operation precautions:

6. File Operations

(1) Opening and closing files:

(2) File reading and writing:

(3) File operation process:

(4) File opening failure handling:


IV. Test Paper Structure

Total Score: 100 points

Question Types:

  1. Program fill-in-the-blank questions - 2 questions, 20 points
    • Given incomplete program code, candidates complete missing parts according to requirements
  2. Function questions - 1 question, 15 points
    • Given main function, candidates implement specified function without modifying main function
  3. Programming design questions - 3 questions, 65 points
    • Given specific problem requirements, candidates design and write complete program code

V. Question Setting Requirements

  1. All exams use an online programming evaluation system (OJ)
  2. Candidates can submit code multiple times
  3. System returns evaluation results in real-time
  4. Final answer is the candidate’s last submission for each question
  5. Exam time: 90 minutes
  6. Questions cover knowledge points of each module
  7. Difficulty ratio:
    • Easy: 20%
    • Relatively easy: 35%
    • Relatively difficult: 35%
    • Difficult: 10%

VI. Exam Network Environment Requirements

The exam environment must meet:


VII. Notes


VIII. Question Type Examples

1. Program Fill-in-the-Blank Question

Question Description:

The following code intends to implement “input 5 integers into an array, calculate the average of array elements and output (retain 1 decimal place)”. Please complete the missing code to ensure the program functions correctly.

Fill-in-the-blank program:

#include <stdio.h>
int main() {
    int arr[5];
    int i;
    float avg, sum = 0.0;
    
    // Blank 1: Loop to input 5 integers into array arr
    for (i = 0; i < 5; i++) {
        ____________________; 
    }
    
    // Blank 2: Loop to accumulate array elements into sum
    for (i = 0; i < 5; i++) {
        ____________________; 
    }
    
    // Blank 3: Calculate average (sum divided by number of elements 5)
    avg = ____________________; 
    
    // Blank 4: Output average, retain 1 decimal place
    ____________________; 
    
    return 0;
}

Reference Answer:


2. Function Question

Question Description:

Given the main function code, implement the function countOdd with the following functionality: count the number of odd numbers among the first n elements of array arr and return that count.

Main function as follows:

#include <stdio.h>
#define N 50

// Function declaration
int countOdd(int arr[], int n);

int main() {
    int arr[N], n, cnt;
    
    // Input number of array elements
    scanf("%d", &n);
    
    // Input n integers into array
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }
    
    // Call function to count odd numbers
    cnt = countOdd(arr, n);
    
    // Output result
    printf("Number of odd numbers: %d\n", cnt);
    
    return 0;
}

/* Please write the countOdd function here */

Reference Answer:

int countOdd(int arr[], int n) {
    int count = 0; // Initialize odd number counter to 0
    
    // Traverse the first n elements of the array
    for (int i = 0; i < n; i++) {
        // Check if current element is odd (remainder not 0 when divided by 2)
        if (arr[i] % 2 != 0) {
            count++; // Increment odd number counter by 1
        }
    }
    
    return count; // Return number of odd numbers
}

3. Programming Question

Question Description:

Write a complete program to implement “student grade level judgment” function.

Specific requirements:

Reference Answer:

#include <stdio.h>
#include <string.h> // For string processing (can be omitted in this question, but kept for standards)

int main() {
    // Define arrays to store names and scores of 3 students
    char name[3][11]; // 3 strings, each maximum 10 characters (plus '\0')
    int score[3];
    char grade; // Store individual student's grade
    
    // Input information for 3 students
    for (int i = 0; i < 3; i++) {
        printf("Please enter the name and score of student %d (separated by space): ", i+1);
        scanf("%s %d", name[i], &score[i]); // Name without spaces, use %s for input
    }
    
    // Process and output results
    for (int i = 0; i < 3; i++) {
        // Determine grade based on score
        if (score[i] >= 90 && score[i] <= 100) {
            grade = 'A';
        } else if (score[i] >= 80 && score[i] <= 89) {
            grade = 'B';
        } else if (score[i] >= 70 && score[i] <= 79) {
            grade = 'C';
        } else if (score[i] >= 60 && score[i] <= 69) {
            grade = 'D';
        } else {
            grade = 'E';
        }
        
        // Output result
        printf("%s: %d-%c\n", name[i], score[i], grade);
    }
    
    return 0;
}

Back Donate