Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 2 pages
Exam (elaborations)

CMIS 141 Quiz 3 Latest Questions with Answers in red. This Quiz Received 100%

Document preview thumbnail
Preview 1 out of 2 pages

Answers in red. This quiz received 100% Question 1 (10 points) Write a method that computes the average of the values in an array of doubles. The header of the method is as follows: public static double average(double[] x) public static double average(double [] x) { double sum=0; for( int i=0 ;ih ;i++) { sum+=x[i]; } return (sum/h); } Question 2 (20 points) Write a complete Java class that will create a 2D array of randomly generated ints with dimensions of 5 rows and 10 columns. Print the values of each cell to a 5x10 table. (Note: a complete Java class means the code should compile and run without issue. Be sure the output displays a set of random ints formatted in 5 rows by 10 columns. // Graded Quiz 3 // Developer: // Course: CMIS141, Section 7981 // Professor: R. Rowson import .Random; public class Array2D { int aR1[ ][ ]; public Array2D() { Random r=new Random(); aR1 = new int[5][10]; for(int i=0;i5;i++) { for(int j=0;j10;j++) { aR1[i][j]=(int)Int(50); //Random Numbers from 0 to 49 inclusive } } } public void display() { for(int i=0;i5;i++) { for(int j=0;j10;j++) { S(aR1[i][j]+"t"); } Sln(""); } } public static void main(String[] args) { Sln("n2D Array Output"); Array2D gew=new Array2D(); ay();


Document information

Uploaded on
September 2, 2021
Number of pages
2
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers
$10.05

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TESTSOURCE
3.5
(94)
Sold
524
Followers
485
Items
1535
Last sold
9 months ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.