Tải bản đầy đủ (.pdf) (2 trang)

Lab 1 introduction

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (185.99 KB, 2 trang )

Course: Programming Fundamentals (C language)
LAB 1 – C Programs: Introduction
Main content:
1.
2.
3.
4.

Get used to IDEs
Get used to programming with the C language
Use the printf() and scanf() functions and other library functions
Check coding styles

Practice:
1. Get used to IDEs
Open the IDE tool and examine the functionalities provided by the tool.
- How to start generating a C source code file
- How to compile a C source code file
- How to run a resulting C program
2. Get used to programming with the C language
2.1. Write a program to find a larger box between two boxes given the width, length, and height
of each box using pseudo code or flowchart.
2.2. Write a program to find the shortest path between two places in a city using pseudo code
or flowchart. It is supposed that a city is viewed in a 2-D space. The city includes n
connected places and each place is represented as a point in that 2-D space.
2.3. Sketch the main components of the program in question (2.1) using the C language
2.4. Sketch the main components of the program in question (2.2) using the C language
3. Use the printf() and scanf() functions and other library functions
3.1. Write a C program to receive the values from the keyboard for the width, length, and height
of each box in question (2.1). Print the information of each box (size, volume) on the screen.
3.2. Write a C program to receive the values from the keyboard for two places in the city in


question (2.2). Print the information of each place on the screen using three decimal
positions after the decimal point. How far are two places from each other?
3.3. It is supposed that each place has a name known by tourists. Some are listed as follows:
___________________________
|
|
|
|
|Place
|
X|
Y|
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ |_ _ _ _ _|
|
|
|
|
|Ho Chi Minh museum
|
10|
9.4|
|Independence palace
|
2.5|
8|
|City post office
|
7.3|
6.7|
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ |_ _ _ _ _|

Write a C program to display the aforementioned table of the listed places.
1


3.4. Write a program to ask at least one of your friends to answer the following questions and
display the information your program has received on the screen:
- What is the first letter of your first name? If your friend doesn’t enter a capital letter, then
change it to a corresponding capital letter before printing it on the screen.
- What is your full name?
- Where are you from?
- What is your student identifier?
- What is your entrance year?
- How many courses are you studying?
- What is your current GPA grade?
4. Check coding styles
How have you used blank lines?
How have you used tabs for alignment?
How have you used comments in your source code files?
Above all, how about your naming conventions? What have you named in your source code
files?

2



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×