SlideShare a Scribd company logo
1 of 13
TRƯỜNG ĐẠI HỌC SƯ PHẠM TP.HCM
KHOA CÔNG NGHỆ THÔNG TIN
SƯ PHẠM TIN 3

GVHD:

Thầy Nguyễn Khắc Văn.

Ngươi thực hiện:

› Trần Thông Minh.
Nhắc lại:
Cấu trúc của một chƣơng
trình Pascal.
Cú pháp.
Các lệnh vào ra cơ bản.

TIÊU ĐỀ
program Giai_PTB2;
uses crt;
KHAI BÁO
var a,b,c,D:real;
x1,x2:real;
begin
clrscr;
write('Nhap a,b,c:');
readln(a,b,c);
D:=b*b - 4*a*c;
x1:= (-b-sqrt(D)/(2*a));
x2:= -b/a -x1;
write('x1=' ,x1:6:2, 'x2' ,x2:6:2);
readln
end.

THÂN CT
Nhắc lại:
Cấu trúc của một chƣơng
trình Pascal.
Cú pháp.
Các lệnh vào ra cơ bản.

Dấu chấm phẩy đƣợc dùng để ngăn cách giữa các câu
lệnh. Không nên hiểu dấu chấm phẩy là dấu kết thúc
câu lệnh. Ví dụ:
FOR i:=1 TO 10 DO Write(i);
Định danh là một dãy ký tự dùng để đặt tên cho các
hằng, biến, kiểu, tên chƣơng trình con... Khi đặt tên, ta
phải chú ý một số điểm sau:

Không đƣợc đặt trùng tên với từ khoá

Ký tự đầu tiên của tên không đƣợc bắt đầu bởi
các ký tự đặc biệt hoặc chữ số.

Không đƣợc đặt tên với ký tự space,các phép
toán.
Nhắc lại:
Cấu trúc của một chƣơng
trình Pascal.
Cú pháp.
Các lệnh vào ra cơ bản.

Để đưa dữ liệu ra màn hình Pascal cung cấp thủ
tục chuẩn:
write(<danh sách kết quả ra>);
hoặc:
writeln(<danh sách kết quả ra>);
Nhập dữ liệu vào từ bàn phím được thực hiện
bằng thủ tục chuẩn:
Read(<danh sách biến vào>);
Hoặc
Readln(<danh sách biến vào>);
Chƣơng
trình?

Ngôn ngữ
lập
trình??

Môi
trƣờng lập
trình???
Chƣơng trình là dãy các lệnh mà máy tính có thể
hiểu và thực hiện đƣợc.

Diagram

Là ngôn ngữ dùng để viết cho các chƣơng trình chạy
trên máy tính.

Chƣơng trình soạn thảo và chƣơng trình dịch cùng
với các công cụ trợ giúp tìm kiếm, sửa lỗi hoặc thực
hiện chƣơng trình đƣợc kết hợp vào một phần mềm.
Program

Pascal
Program
BÀI 8: SOẠN THẢO, HIỆU
CHỈNH BIÊN DỊCH
CHƢƠNG TRÌNH

Nguyễn Văn A
avn@gmail.com
Chú ý:

Để lập trình đƣợc với Turbo Pascal, tối thiểu
cần 2 file sau:

TURBO.EXE: Dùng để soạn thảo và
dịch chƣơng trình.

TURBO.TPL: Thƣ viện chứa các đơn vị
chuẩn để chạy với TURBO.EXE.
Ngoài ra, muốn lập trình đồ hoạ thì phải cần
thêm các tập tin:

GRAPH.TPU: Thƣ viện đồ hoạ.

*.BGI: Các file điều khiển các loại màn
hình tƣơng ứng khi dùng đồ hoạ.

*.CHR: Các file chứa các font chữ đồ
họa.
Nếu muốn xem hƣớng dẫn sử dụng Turbo
Pascal thì cần có thêm tập tin TURBO.HLP
Các thao tác cơ bản.
-Lƣu tệp vào đĩa: F2
-Mở tệp đã có: F3
-Biên dịch chƣơng trình: Alt + F9

-Chạy chƣơng trình: Ctrl + F9
-Xem lại màn hình kết qủa: Alt + F5

-Thoát chƣơng trình: Alt + F4
Demo giới thiệu Turbo Pascal
CỦNG CỐ BÀI HỌC

Sau bài học
này, các em
cần nhớ những
gì?
Bài 8 SOẠN THẢO, DỊCH, THỰC HIỆN VÀ HIỆU CHỈNH CHƯƠNG TRÌNH

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Bài 8 SOẠN THẢO, DỊCH, THỰC HIỆN VÀ HIỆU CHỈNH CHƯƠNG TRÌNH

  • 1. TRƯỜNG ĐẠI HỌC SƯ PHẠM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN SƯ PHẠM TIN 3 GVHD: Thầy Nguyễn Khắc Văn. Ngươi thực hiện: › Trần Thông Minh.
  • 2. Nhắc lại: Cấu trúc của một chƣơng trình Pascal. Cú pháp. Các lệnh vào ra cơ bản. TIÊU ĐỀ program Giai_PTB2; uses crt; KHAI BÁO var a,b,c,D:real; x1,x2:real; begin clrscr; write('Nhap a,b,c:'); readln(a,b,c); D:=b*b - 4*a*c; x1:= (-b-sqrt(D)/(2*a)); x2:= -b/a -x1; write('x1=' ,x1:6:2, 'x2' ,x2:6:2); readln end. THÂN CT
  • 3. Nhắc lại: Cấu trúc của một chƣơng trình Pascal. Cú pháp. Các lệnh vào ra cơ bản. Dấu chấm phẩy đƣợc dùng để ngăn cách giữa các câu lệnh. Không nên hiểu dấu chấm phẩy là dấu kết thúc câu lệnh. Ví dụ: FOR i:=1 TO 10 DO Write(i); Định danh là một dãy ký tự dùng để đặt tên cho các hằng, biến, kiểu, tên chƣơng trình con... Khi đặt tên, ta phải chú ý một số điểm sau:  Không đƣợc đặt trùng tên với từ khoá  Ký tự đầu tiên của tên không đƣợc bắt đầu bởi các ký tự đặc biệt hoặc chữ số.  Không đƣợc đặt tên với ký tự space,các phép toán.
  • 4. Nhắc lại: Cấu trúc của một chƣơng trình Pascal. Cú pháp. Các lệnh vào ra cơ bản. Để đưa dữ liệu ra màn hình Pascal cung cấp thủ tục chuẩn: write(<danh sách kết quả ra>); hoặc: writeln(<danh sách kết quả ra>); Nhập dữ liệu vào từ bàn phím được thực hiện bằng thủ tục chuẩn: Read(<danh sách biến vào>); Hoặc Readln(<danh sách biến vào>);
  • 6. Chƣơng trình là dãy các lệnh mà máy tính có thể hiểu và thực hiện đƣợc. Diagram Là ngôn ngữ dùng để viết cho các chƣơng trình chạy trên máy tính. Chƣơng trình soạn thảo và chƣơng trình dịch cùng với các công cụ trợ giúp tìm kiếm, sửa lỗi hoặc thực hiện chƣơng trình đƣợc kết hợp vào một phần mềm.
  • 8. BÀI 8: SOẠN THẢO, HIỆU CHỈNH BIÊN DỊCH CHƢƠNG TRÌNH Nguyễn Văn A avn@gmail.com
  • 9. Chú ý: Để lập trình đƣợc với Turbo Pascal, tối thiểu cần 2 file sau:  TURBO.EXE: Dùng để soạn thảo và dịch chƣơng trình.  TURBO.TPL: Thƣ viện chứa các đơn vị chuẩn để chạy với TURBO.EXE. Ngoài ra, muốn lập trình đồ hoạ thì phải cần thêm các tập tin:  GRAPH.TPU: Thƣ viện đồ hoạ.  *.BGI: Các file điều khiển các loại màn hình tƣơng ứng khi dùng đồ hoạ.  *.CHR: Các file chứa các font chữ đồ họa. Nếu muốn xem hƣớng dẫn sử dụng Turbo Pascal thì cần có thêm tập tin TURBO.HLP
  • 10. Các thao tác cơ bản. -Lƣu tệp vào đĩa: F2 -Mở tệp đã có: F3 -Biên dịch chƣơng trình: Alt + F9 -Chạy chƣơng trình: Ctrl + F9 -Xem lại màn hình kết qủa: Alt + F5 -Thoát chƣơng trình: Alt + F4
  • 11. Demo giới thiệu Turbo Pascal
  • 12. CỦNG CỐ BÀI HỌC Sau bài học này, các em cần nhớ những gì?