1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Hoochie [10]
3 years ago
6

Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n

um2) { int product; product = num1 * (int)num2; System.out.println("The product is " + product); }
Computers and Technology
1 answer:
Alenkinab [10]3 years ago
3 0

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

You might be interested in
Why now days 3D images are used in cartoons? What are the drawbacks of 2D image?
antoniya [11.8K]

Answer:

There are no drawbacks

Explanation:

People just think 3D is more modern-ish. I liked 2D better, but whatever- things are changing.

5 0
3 years ago
Read 2 more answers
For this activity, you will practice being both proactive and reactive to bugs. Both are necessary to get rid of errors in code.
Illusion [34]

Answer:

okk

Explanation:

4 0
3 years ago
________ uses shared computing resources instead of having local servers or devices to handle computing applications.
Oksanka [162]

Answer:

cloud computing

Explanation:

3 0
3 years ago
Compare and contrast the following codes of ethics, including a listing of their similarities and differences: The ACM Code of E
lora16 [44]

Answer:

Please see the explanation

Explanation:

ACM professional code has following characteristics:

Genaral moral Imperative- This further consists of:

Contribute to society and human well being

Avoid harm to others

Be honest and trustworthy

Honor property rights including copyrights and patent

Respect the privacy of other

2) Professional responsibilities

Acquire and maintain professional coompetence

Achieve the highest quality

Accept and provide appropriate professional review

Respect the existing laws

Access computing and communication resources only when authorized to do so.

3) Organizational leadership

Articulate social responsibilities of members of an organizational unit and encourage full acceptance of those responsibilities.

Manage personnel and resources to design and build information systems that enhance the quality of working life.

Ensure that users and those who will be affected by a system have their needs clearly articulated during the assessment and design of requirements; later the system must be validated to meet requirements.

Create opportunities for members of the organization to learn the principles and limitations of computer systems.

4) Compliance with Code

Uphold and promote the principles of this Code.

Treat violations of this code as inconsistent with membership in the ACM.

Software Engineering Code of Ethics and Professional Practice

In accordance with their commitment to the health, safety and welfare of the public, software engineers shall adhere to the following Eight Principles:

Public: Software engineers shall act consistently with the public interest.

Client and Employer: Software engineers shall act in a manner that is in the best interests of their client and employer, consistent with the public interest.

Product: Software engineers shall ensure that their products and related modifications meet the highest professional standards possible.

Judgement: Software engineers shall maintain integrity and independence in their professional judgment.

Management: Software engineering managers and leaders shall subscribe to and promote an ethical approach to the management of software development and maintenance.

Profession: Software engineers shall advance the integrity and reputation of the profession consistent with the public interest.

Colleagues: Software engineers shall be fair to and supportive of their colleagues.

Self: Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.

Australian Code of Professional Conduct

As an ACS member you must uphold and advance the honour, dignity and effectiveness of being a professional. This entails, in addition to being a good citizen and acting within the law, your conformance to the following ACS values.

1. The Primacy of the Public Interest

You will place the interests of the public above those of personal, business or sectional interests.

2. The Enhancement of Quality of Life

You will strive to enhance the quality of life of those affected by your work.

3. Honesty

You will be honest in your representation of skills, knowledge, services and products.

4. Competence

You will work competently and diligently for your stakeholders.

5. Professional Development

You will enhance your own professional development, and that of your staff.

6. Professionalism

You will enhance the integrity of the ACS and the respect of its members for each other.

In a situation of conflict between the values, The Primacy of the Public Interest takes precedence over the other values.

This Code of Professional Conduct is aimed specifically at you as an individual practitioner, and

is intended as a guideline for your acceptable professional conduct. It is applicable to all ACS

members regardless of their role or specific area of expertise in the ICT industry

All the three codes focus on the public interest, honestl, loyalty, ensuring quality of life, and professional development.

In Australian Code of conduct, in a situation of conflict between the values, The Primacy of the Public

Interest takes precedence over the other values, while there is no such thing in other two codes.

Software Engineering Code of Ethics and Professional Practice includes development of self, that is, Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession, which is not usually seen in other two codes.

8 0
3 years ago
Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jer
tiny-mole [99]

Answer:

  1. import java.util.Scanner;
  2. public class Main {
  3.    public static void main (String [] args) {
  4.        int jersey_num [] = new int[5];
  5.        int rating [] = new int[5];
  6.        Scanner inStream = new Scanner(System.in);
  7.        for(int i=0; i < 5; i++){
  8.            System.out.print("Enter player " + (i+1) + "'s jersey number:");
  9.            jersey_num[i] = inStream.nextInt();
  10.            System.out.print("Enter player " + (i+1) + "'s rating:");
  11.            rating[i] = inStream.nextInt();
  12.        }
  13.        System.out.println("ROSTER");
  14.        for(int j=0; j < 5; j++){
  15.            System.out.println("Player " + (j+1) + "-- Jersey number: " + jersey_num[j] + ", Rating: " + rating[j]);
  16.        }
  17.    }
  18. }

Explanation:

The solution code is written in Java. Firstly create two array, jersey_num and rating, with int type. This is to hold the five pairs of numbers input by user (Line 6 -7).

Next, create a for loop that run for 5 iterations and in each iteration prompt user to input jersey number and rating (Line 11 -17). The input number and rating will be set to the array, jersey_num and rating, respectively.

Next, print the title "Roster" (Line 19).

Create another for loop to display the five input pair of values (Line 21 - 23).

3 0
3 years ago
Other questions:
  • Observing users as they enter passwords or other personal information to a computer Auditing software often used to test compute
    6·1 answer
  • Which practice enables recovery of accidental deletions in data records?
    15·2 answers
  • You can italicize a word by selecting it and clicking the Italics icon. What keyboard shortcut could you use instead of clicking
    11·1 answer
  • The automatic number of worksheets that appear when you open a blank Excel workbook is ? 1.One 2.Three 3.Six 4.Ten
    8·1 answer
  • I need them on this question
    5·1 answer
  • Which is better Play Station Xbox or PC
    14·2 answers
  • The following method is intended to remove all values from the ArrayList a that have the same value as val; however, this method
    8·1 answer
  • Think of a genre (science, music, math, sports, video games, etc.) and create at least 10 questions. You can decide whether you
    12·2 answers
  • Reflect on your semester in this class analysis and Design from an overall "experience" perspective
    9·1 answer
  • To view a friend's calendar, you must request access.<br> A) True<br> B) False
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!