mimiaarabi
BAN USER
- 1of 1 vote
AnswerWrite a method called createArray that accepts 4 parameters: number of rows, number of columns, a and b.
- mimiaarabi in United States
This method creates a 2-D array of number rows and columns as given in the parameter, then fills the array
with random values between a and b.
Write another method called checkColumn which accepts the position of the column, the min and max
elements of the array as parameter and returns true if the column contains both the minimum value and
maximum value, false otherwise.
Finding the min and max can be done in the main.
Sample run:
Enter number of rows and columns: 3 2
Enter 2 integers: 25 40
Array Elements:
26 32
39 28
27 30
Minimum: 26 Maximum: 39
Enter the position of the column to check: 0
Column 0 contains both min and max.| Report Duplicate | Flag | PURGE
Internet Question Java - 0of 0 votes
AnswerWe need to develop a game that allows two players to throw a dice ten times and the player who gets the
- mimiaarabi in United States
highest sum wins the game.
Write a method sum(int[] values) that returns the sum of elements of the array values.
Write a method display(int[] values) that displays the elements of the array values.
Write a main method where you should:
a) Create two arrays of integers called player1 and player2 with size 10 both
b) For each player, generate ten random integers between 1 and 6 inclusively. The generated values
are added to the associated array of each player.
c) Display the generated values for each player.
d) Find and display the winner using the sum method.
Sample run
Generated numbers for player 1 are: 6 6 3 1 2 1 4 6 5 4
Generated numbers for player 2 are: 6 2 2 4 2 1 1 5 2 4
Player 1 wins with score 38| Report Duplicate | Flag | PURGE
Internet Question Java - 0of 0 votes
Answer[Applying a curve to grades] Write a method called “applyCurve” that takes as a parameter a single-
- mimiaarabi in United States
dimensional array called “grades” of integers and a single value integer called “raise”. This method should
modify the array “grades“, which contains the grades of students in a way that each value in the array is
added to it the curve value “raise”. You should check that the grades after applying the raise does not exceed
100.
For example, if array “grades” contains the following values:
95 100 24 43 76 51 87
0 1 2 3 4 5 6
After calling the method “applyCurve” with a raise value +7 the array grades would be as follows:
100 100 31 50 83 58 94
0 1 2 3 4 5 6
Write a test program (main) that prompts the user to enter the size of an array, the grades and the required
curve and then displays the grades after applying a required curve.
Sample run
Enter the array size: 7
Enter the grades: 95 100 24 43 76 51 87
Enter the required curve: 7
The grades after applying + 7 are: 100 100 31 50 83 58 94| Report Duplicate | Flag | PURGE
Internet Question Java
Reprameshdondu15, Analyst at ASAPInfosystemsPvtLtd
My name is Ramesh dondu from India. I burn through 2009 to on words consistently work in Interior planner. I ...
Repmarilynarhea, Computer Scientist at ABC TECH SUPPORT
I live my life very happily by god grace and I am working as a Gaming machine servicer and my ...
RepTop Tiers provides latest english premier league articles and news to keep you up to date. Visit our website today ...
RepWant to know how to protect from black magic? Guru Ji is the world’s famous astrologer and he has ...
RepOur mission is to provide informative and Self Improvement advice to help people live their lives better set definite goals ...
Replarrymmapp, Android test engineer at Software AG
Hello, I am name and I live in a city, USA. I am a professional's Podiatric doctor. I am ...
RepStonefire Arms manufacture and bring Firearms parts & accessories to the market at reasonable prices. We offer a wide variety of ...
Repuspoolbuilderus, Site Reliability Engineer at Delve Networks
U.S. Pool Builder is the best licensed inground concrete pool design and swimming pool builders katy TX.Our main ...
RepShirleyMHansen, Project Leader at Chelsio Communications
I am Physical Therapy Aide with 3 years experience in hospital. I like to build up my knowledge of various ...
RepJohn Colcomb, Analyst at A9
With more than 20 years of car rental and dealership experience, responsible for developing growth strategies to maximize operational effectiveness ...
RepDeveloped several new methods for licensing g.i. joes in Los Angeles, CA. Spent high school summers creating marketing channels ...
RepRocioNavarro189, None at Student
Hello Everyone,My name is Rocio Navarro Form Auckland,NZ,and 31 years old.I am searching for a servant ...
RepSherryellis555, Computer Scientist at ASAPInfosystemsPvtLtd
My name is Sherri Ellie Once had a fantasy of testing the market for tar in Georgia, GE. Rehearsed in ...
RepAre you looking for a simple remedy mantra or solution to seduce your husband? Is your husband not caring about ...
RepChristinaDDooley, Tech Lead at Car Rental
Rent the stylish, royal & Luxury Cars in Miami.We have become known worldwide by providing Luxury car rental Miami and ...
Repfesfporyi212, Member Technical Staff
My self Fesfpory. I work in agriculture university in India as a professor. I done PHD in Botany in Punjab ...
RepAlisonjaeger755, Data Engineer at Accolite software
I am work in Telecom line in IDEA company. I am data operator and Engineer in back end in Idea ...
RepCrystalday777, Computer Scientist at AMD
My name is Crystal Day; I'm from Sydney, Australia, Get Ex Lost Love Back and I'm a sophomore ...
Repritahmixon, Analyst at ADP
Hi, I am a physiotherapy to help people handle everyday problems. I also assist peoples who have issues caused by ...
Repmaccydonal4747, Data Engineer at A9
Hi my sweet companions! My name is Maccy Donal, I conceived in Canada Toronto 1994 and I am unceasingly appreciative ...
Repgarycsroka, Backend Developer at Axiom Sources
Hi I’m Gary, an average 19 year old in a state college who sees life as an adventure.Provide ...
Open Chat in New Window