我可以: 邀请好友来看>>
ZOL星空(中国) > 技术星空(中国) > C/C++星空(中国) > 代写C语言 代做C程序 C++ 英文小程序
帖子很冷清,卤煮很失落!求安慰
返回列表
签到
手机签到经验翻倍!
快来扫一扫!

代写C语言 代做C程序 C++ 英文小程序

79浏览 / 0回复

daixiec

daixiec

0
精华
5
帖子

等  级:Lv.1
经  验:50
  • Z金豆: 0

    千万礼品等你来兑哦~快点击这里兑换吧~

  • 城  市:北京
  • 注  册:2012-09-13
  • 登  录:2014-08-10
发表于 2013-07-09 14:33:36
电梯直达 确定
楼主

QQ2365427650

Write a program to process a collection of daily high temperatures. Your program should count and print the number of “hot days” (temperatures of 25oC or higher), the number of “pleasant days” (temperatures 16oC - 24oC), and the number of “cold days” (temperatures of less than 16oC). It should also display the category of each temperature. Test your program on the following data:

16, 23, 22, 28, 31, 5, 19, 23, -5, 26, 27, 9, 12, 14, 34, 12, 15, 32, 28, 24, 12, -3, 19, 26, 34, 12

(Hint: declare and initialise an array with these numbers at the beginning of the program)

Also, modify your program to display the average temperature (a real number) at the end of the run.

Do not forget to produce the design document for this exercise!

 

Write a program that initialises an array of double and then copies the contents of the array into two other arrays. Declare all arrays in the main program.

To make the first copy, make a function, which uses the array notation (the square brackets []) to access the elements of the array.

To make the second copy, write a function that uses the pointer notation and pointer incrementing to access the elements of the arrays. 

Have each function take as function arguments the name of the target array and the number of elements to be copied.

Here is an example showing how the functions should be called, given the following declarations:

double source[4] = {1,2.3,4.5,6.7};

double destination1[4];

double destination2[4];

copy_array(source, destination, 4);

Write a program that declares a 3 by 5 two-dimensional array and initialises it with some values of your choice. The program should:

  1. print all the values,
  2. double the values
  3. print again all the values

Write a function that is responsible for displaying the values and a second function that doubles the values. The functions could take as arguments the array name and the number of rows as arguments.

 

Exercise

EdgeLane Airlines has a fleet of one plane with a seating capacity of 14 arranged as 7 rows (1 to 7) of two seats (A and B) (i.e. the seat identification labels are 1A, 1B, …). It makes one flight a day. Write a seating reservation program with the following features:

  1. The program uses an array of 14 structures. Each structure should hold a seat identification label, a flag that indicates whether the seat is assigned, the last name of the seat holder (max 20 characters), and the first name of the seat holder (max 20 characters).
  2. The program displays the following menu:

To choose a function, enter its letter label:

a) Show assigned seats with passenger names.

b) Show list of empty seats.

c) Assign a customer to a seat.

d) Edit customer details, for a specific seat.

e) Delete a seat assignment.

f) Quit.

After executing a particular function the program should show the menu again except for choice (f)

  1. The program should save the data in a file between runs and load the data (if any) at the start of the program.
高级模式
星空(中国)精选大家都在看24小时热帖7天热帖大家都在问最新回答

针对ZOL星空(中国)您有任何使用问题和建议 您可以 联系星空(中国)管理员查看帮助  或  给我提意见

快捷回复 APP下载 返回列表