Prompt Engineering Lesson Plan for Computer Science Students

Objective: To introduce computer science students to the concept of Prompt Engineering (PE) and provide a foundational understanding of how to create effective programming and coding prompts.

Steps:

1.                   Can you recall a coding assignment or prompt that you found particularly challenging? What aspects of the prompt made it difficult to approach?

2.                   Have you ever encountered a coding prompt that lacked clarity or didn't align with coding standards? How did it impact your approach to the assignment?

3.                   Conversely, can you think of a coding prompt that was exceptionally clear and effective? How did it contribute to your understanding and success in the assignment?

4.                   What do you believe are the essential components of a well-crafted coding prompt? What elements should it include to guide you effectively in coding and problem-solving?

5.                   How do you think understanding the concept of PE and applying it to coding prompts can improve your coding skills and overall computer science education?

Problems: This prompt is overly general and lacks details about the list, sorting algorithm, or any constraints.

Improvements: The edited prompt specifies the sorting algorithm (merge sort), the type of data (integers), the desired order (ascending), and constraints (time complexity, list size), providing clear guidance to students.

Example Coding Prompts:

Problems: This prompt is overly general, lacks specific details about the list, and doesn't specify whether the program should be in a particular programming language.

Properly Edited Prompt: Implement a Python program to calculate the sum of integers in a given list. The program should handle both positive and negative integers and provide the result as the output.

Improvements: The edited prompt specifies the programming language (Python), the data type (integers), the expected behavior (calculating the sum), and the output format, making it clear and guiding students effectively.

Problems: This prompt is overly vague and doesn't indicate the type of data, sorting criteria, or programming language to be used.

Properly Edited Prompt: Write a Java function that implements the quicksort algorithm to sort an array of integers in ascending order. The function should have a time complexity of O(n log n).

Improvements: The edited prompt specifies the programming language (Java), the sorting algorithm (quicksort), the data type (integers), the desired order (ascending), and the expected time complexity, providing clear guidance.

Problems: This prompt is overly vague and doesn't specify the problem to be solved, the input data, or the expected output.

Properly Edited Prompt: Write a Python program to find the two numbers in an array that add up to a specific target value. The program should return the indices of the two numbers.

Improvements: The edited prompt specifies the programming language (Python), the problem statement (finding two numbers that add up to a target), the input data (array), and the expected output (indices), providing clear guidance to students.

Problems: This prompt is overly broad and doesn't specify the type of software, its features, or the programming language to be used.

Properly Edited Prompt: Create a web-based weather forecasting application using JavaScript and the OpenWeatherMap API. The application should allow users to input a location and display current weather conditions.

Improvements: The edited prompt specifies the type of software (weather forecasting application), the programming language (JavaScript), the external data source (OpenWeatherMap API), and the expected features, providing clear guidance to students.