Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CCCS 529 Selected Topics, Summer 2021

Assignment 04– Chapter 06,07


Due Wednesday 16 June 2021 10:20 am

All Assignments should be submitted via Black Board. Late submission will not be accepted.
You need to include the code and a sample run of your program in a single pdf file. Please
solve all questions as asked to get the full grades of the assignment.

1. Write a program that writes a series of random numbers to a file (the program should ask
the user for the name of the file). Each random number should be in the range of 1
through 100. The application should let the user specify how many random numbers the
file will hold.

2. Write a program that reads the random numbers from the file (created in Question 1),
store the numbers in a list, print the numbers in the screen, and then display the following
data:
a. The maximum number in the list.
b. The minimum number in the list.
c. The total of the numbers.
d. The average of the numbers.
e. The number of random numbers read from the file.
f. Sort the list.
g. The median of the list. (if you do not know median, go and search).
h. Add a new random number (that range between 1 to 100) at the end of the list.
i. Remove the second item from the beginning and the second item from the end of
the list.

Good luck and enjoy coding. For any question, please contact me at sghanem@uj.edu.sa

You might also like