CS365 Program 1- current programming languages Solved

30.00 $ 15.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

Rate this product

Objective

Familiarity with the current programming languages

Assignment

Write a same program in both Python and Java that fill an array/list with random integer values between 0 and 100 inclusive (think test scores, no bonus points), displays the high score, the low score, and the average (with 2 places after the decimal point). The array/list should store exactly 20 integers.

The two languages tend to use different terminology for similar language components. For this program description I will refer to an array (Java) or a list (Ptython) as an array. I will refer to a method (Java) or a function (Python) as a function, just for simplicity.

The main program must be implemented as follows:

Create array

Call function to accept the array and fill it with random values Call function to accept the array and return the high value Print the returned value

Call function to accept the array and return low value Print the returned value

Call function to accept the array and return the average Print returned value

Call function to print out a counting value (1-20) and all twenty values to the display

Note that ALL MOST ALL OF THE WORK IS TO BE DONE IN FUNCTIONS. Create the array in the “main” part of the program. Then call the various functions. The functions that return a value should not generate output. The final function will generate output and not return anything.

To generate pseudo-random numbers look for the following commands as a starting point:

Python – random.randint()

Java – Random().nextInt()

You don’t have to use these commands; they are just suggestions.

A sample of the output might be (with made-up data):

High value 93

Low value  17

Average 53.24

 

Values

  • 26
  • 93
  • 65 …

20 43

 

At some point after the assignments have been graded there will be questions asked in class discussing differences in how the various commands are implemented in the two languages

  • program1_ECorpus-6lswmk.zip