1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Lab 6 functions

2 0 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Course Programming Fundamentals (C language) 1 LAB 6 – Functions Main content 1 Get used to standard library functions 2 Get used to function definitions and function calls 3 Start more complex data p[.]

Course: Programming Fundamentals (C language) LAB – Functions Main content: Get used to standard library functions Get used to function definitions and function calls Start more complex data processing Check coding styles Practice: Get used to standard library functions 1.1 Write a C program to approximate a value of the function ex using a function for your approximation and then use a corresponding function pow() in the standard library to evaluate your approximated values 1.2 Write a C program to check if a user has entered an alphabetic letter from the keyboard till the user enters # How many times has the user entered an alphabetic letter? What is the percentage of that event? For checking a character input by a user, define and use a corresponding function and then use a standard function provided by the library 1.3 Write a C program to compute an average grade of at least three courses that you studied last semester It is supposed that the average grade is rounded with two digits after the floating point Can we use any existing function in the standard library to round a floating point number in such a context? If yes, compare your rounded number and the one from the function in the standard library Get used to function definitions and function calls 2.1 Given the information of a few students as follows, write a C program to compute the percentage of the students enrolled in 2014 using functions ID 14102054 14210351 15103032 15202412 14113089 14200768 Name John Smith Peter Brown Liz Blair Tony Blade White Depp Daisy Cruise Hometown Chelsea London London London Chelsea London 2.2 Write a C program to count how many numbers X in the Fibonacci series are between the range (min, Max), i.e X > and X < Max and < Max, where and Max are two natural numbers given by a user from the keyboard using functions 2.3 Write a C program to print the reversed numbers of N integer numbers input by a user from the keyboard using functions How many numbers have digits? Start more complex data processing 3.1 Write a C program using functions for question 1.2 in Lab 3.2 Write a C program using functions for question 2.3 in Lab 3.3 Write a C program using functions for question 3.2 in Lab 3.4 Write a C program to recommend the place to a tourist based on his/her current position in such a way that he/she needs to travel in the shortest distance using functions How much does it cost him/her for travelling by taxi? Information about places for recommendation Location Place X Walking street 23.5 Post office 2.8 Church 5.1 Independence palace 1.6 Y 10 4.3 17 2.9 Information about cost Distance (km) Unit price (K) 0

Ngày đăng: 11/04/2023, 18:46

Xem thêm:

w