联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2021-04-03 11:14

Question 1.

Please write a program that display the following results.

Question 2.

Please write a program that prompts the user to enter the int number of students and each student’s score (Integer type, between [0 100]) , then system finally displays the highest score with the student number.



Question 3.

Please write a test program that reads a C-string and displays the number of letters in the string.



Question 4.

Design a class named Location for locating a maximal value and its location in a two-dimensional array. The class contains public data fields row, column=4, and maxValue that store the maximal value and its indices in a two dimensional array with row and column as int type and maxValue as double type. The class also contains a constructor Location(row, column, maxValue) for creating an instance with the specified row, column, and maxValue.

Write the following function that returns the location of the largest element in a two-dimensional array. Assume that the column size is fixed.

const int ROW_SIZE = 3;

const int COLUMN_SIZE = 4;

Location locateLargest(const double a[][COLUMN_SIZE]);

The return value is an instance of Location. Write a test program that prompts, that requires user to input data (double type) for the matrix row-by-row, and enter a 3 by 4 two-dimensional array and displays the location of the largest element in the array.


Question 5.

Please write a program to create a file named Data.txt if it does not exist under current path.

Write 50 integers, that are no greater than 500, created randomly into the file using text I/O. Integers are separated by spaces in the file.

Read the data back from the file and display the sorted data.


版权所有:编程辅导网 2018 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。