Mohd_kayaly
13-05-2006, 11:58 AM
1. Write a C++ program that declares an array alpha of 50 components of the type double. Initialize the array so that the first 25 components are equal to the square of the index variable and the last 25 components are equal to three times the index variable. Output the array so that 10 elements per line are printed.
3. Write a C++ function that reads a file consisting of students' test scores in the range 0-200. It should then determine the number of students having scores in each of the following ranges: 0-24, 25-49, 50-74, 75-99, 100-124, 125-149, 150-174, and 175-200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, and 189.)
5. Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character array to store the string.)
11. Write a program that reads in a set of positive integers and outputs how many times a particular number appears in the list. You may assume that the data set has at most 100 numbers and -999 marks the end of the input data. The numbers must be output in increasing order. For example, for the data:
15 40 28 62 95 15 28 13 62 65 48 95 65 62 65 95 95
the output is:
Number Count
13 1
15 2
28 2
40 1
48 1
62 3
65 3
95 4
3. Write a C++ function that reads a file consisting of students' test scores in the range 0-200. It should then determine the number of students having scores in each of the following ranges: 0-24, 25-49, 50-74, 75-99, 100-124, 125-149, 150-174, and 175-200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, and 189.)
5. Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character array to store the string.)
11. Write a program that reads in a set of positive integers and outputs how many times a particular number appears in the list. You may assume that the data set has at most 100 numbers and -999 marks the end of the input data. The numbers must be output in increasing order. For example, for the data:
15 40 28 62 95 15 28 13 62 65 48 95 65 62 65 95 95
the output is:
Number Count
13 1
15 2
28 2
40 1
48 1
62 3
65 3
95 4