Demonstrate that it works with table and another table

Assignment Help Computer Engineering
Reference no: EM132210053

Write a program that does the following in Java:

Declare a 2 dimensional ragged array of ints.

There is no user input. You can just copy/paste these lines:

int[][] table1 = {

{ 13, 12, 53, 19},

{1, 9, 6, 25,18,17},

{7, 28 4}

};

int[][] table2 = {

{ 13, 13, -85},

{11, 19},

{31, -89, 47, 26, +895 }

};

Write a method called count odds. The signature of the method will be like this:

public static int countOdds(int[][] table)

This method will return the number of elements in the array that are odd numbers. Note that the arrays might be rectangular or ragged.

You might call the method from the main method like this:

int odds;

odds = countOdds(table1);

System.out.println("There are " + odds +" odd numbers in table 1.");

The answer should be 8.

Demonstrate that it works with table2, and another table that you create.

Reference no: EM132210053

Questions Cloud

Write a program that finds all the values in array a : Write a program that finds all the values in array a that is both divisible by 5 and strictly less than 100, and puts those values into array b.
Display both the range of values in the data collection : Write a program that will find the smallest, largest, and average values in a collection of N numbers.
Create added value for adoption and future use in companies : What additional ERP services and features would create added value for adoption and future use in companies?
Write an essay on managerial economics : Lester Scholl's administrative assistant calls you on Monday afternoon to set up a conference call between you and the chairman tomorrow morning to discuss.
Demonstrate that it works with table and another table : This method will return the number of elements in the array that are odd numbers. Note that the arrays might be rectangular or ragged.
Write a personal development plan : BSBWOR501 - Manage personal work priorities and professional development - What interpersonal skills do you use to establish and build positive relationships
Consequences tied to risks in pursuit of performance goals : You witnessed or been a party to in regard to seeing the connection between positive and negative consequences tied to risks in pursuit of performance goals?
Write a program to get the state of pb5 and pb6 bits : Write a program to get the state of PB5 and PB6 bits. When both of them are HIGH, send $FF to PORTC; otherwise send $00 to PORTC.
Identify the key characteristics of the data : Explore the data. Plot and produce summary statistics to identify the key characteristics of the data and produce a report of your findings

Reviews

Write a Review

Computer Engineering Questions & Answers

  Implement needham-schroeder symmetric key protocol both

implement needham-schroeder symmetric key protocol both original version and fixed version using python.the term

  How does one choose the best bit rate for a sound clip

How does one choose the best bit rate for a sound clip? What are the two categories of Flash components? Which event model does Flash use?

  How would you rep-resent the students proficiency levels

Following the discussion in how would you rep-resent the students' proficiency levels in a given class?

  Express why this algorithm favors i/o bound programs

express why this algorithm favors I/O bound programs and yet does not permanently deny processor time to processor bound programs.

  Draw the circuit using multiplexers

A two-bit counter C controls the register transfers shown below.

  Documentation needed to support maintenance activities

Why are additional personnel generally required during the later stages of the system implementation.

  Write pseudocode to sum consecutive even integers

Write pseudocode to sum consecutive even integers. Let the lowest even integer be L and the highest even integer be H, and let both L and H be provided.

  Calculate the difference between them

Calculate the difference between them (i.e. A - B) and store the difference into a memory location labelled D.

  How have the internet intranets and extranets affected the

how have the internet intranets and extranets affected the types and uses of data resources available to business

  Determine a symbolic equation that represents the amount

Suppose that water is being pumped into an initially empty tank. It is known that the rate of the flow of water into the tank at time t (in seconds) is 50-t liters/s.

  Summary on hypertext transfer protocol

Summary on Hypertext Transfer Protocol (HTTP) describing its major features, principles of operation and application in transferring traffic.

  Write a program that provides the requested functionality

Provide a text-menu based user interaction interface - system should repeatedly show the user a menu of possible actions they can perform

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd