Complete the program so that each cell of array sum contains the sum of the corresponding...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Complete the program so that each cell of array sum contains the sum of the corresponding cells of valA and valB: class Exercise3 { public static void main(String[] args) { int[] valA = {13, -22, 82, 17); int[] valB = {-12, 24, int[] sum = { 0, 0, 79, -13); 0, 0}; System.out.println( "sum: + sum [0] + " " + sum [1] + " " sum [2] + " " + sum [3] ); }} + Design new class named Employee. The class contains: private variables: private String name. private Float salary. public methods: setName: that initializes Employee's name, setsalary: that initializes Employee's salary, getsalary: that returns Employee' salary In the java main method: create an Employee object named EmpOne. Set the name of the Employee EmpOne as "Ali" and the salary to "12000". print EmpOne's name and EmpOne's salary. Complete the program so that each cell of array sum contains the sum of the corresponding cells of valA and valB: class Exercise3 { public static void main(String[] args) { int[] valA = {13, -22, 82, 17); int[] valB = {-12, 24, int[] sum = { 0, 0, 79, -13); 0, 0}; System.out.println( "sum: + sum [0] + " " + sum [1] + " " sum [2] + " " + sum [3] ); }} + Design new class named Employee. The class contains: private variables: private String name. private Float salary. public methods: setName: that initializes Employee's name, setsalary: that initializes Employee's salary, getsalary: that returns Employee' salary In the java main method: create an Employee object named EmpOne. Set the name of the Employee EmpOne as "Ali" and the salary to "12000". print EmpOne's name and EmpOne's salary.
Expert Answer:
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date:
Students also viewed these operating system questions
-
The positiontime graphs in Figure P2.15 each describe the possible motion of a particular object. Give at least one example of what the object and motion might be in each case. Figure P2.15 Case 1...
-
In Problems 1 through 10, we have provided the slope field of the indicated differential equation, together with one or more solution curves. Sketch likely solution curves through the additional...
-
In Exercises 1-2, use the formula for the sum of a geometric series to find the sum or state that the series diverges. 1. 2. ++82 + . 8 3 1 3
-
In schema normalisation, is Boyce-Codd Normal Form (BCNF) always to be preferred over 3rd Normal Form (4NF)? Explain your answer. [5 marks] 8 (TURN OVER) CST.2004.7.4 8 Economics, Law and Ethics (a)...
-
Joe wants to rent an apartment with an initial monthly rent of $1,400. He has been told what the landlord raises the rent 1.25% each year. Set up an exponential function that models this situation....
-
An air stripping tower is being designed to treat carbon tetrachloride from 500 to 5 g/L at a temperature of 25 C with a stripping factor of 8. Determine the operating airtowater ratio
-
In the matrix representation the species \(n\) chosen for elimination is usually referred to as the solvent. The choice of "solvent" species is arbitrary, but it can have an effect on the coefficient...
-
House Corporation has been operating profitably since its creation in 1959. At the beginning of 2009, House acquired a 70 percent ownership in Wilson Company. At the acquisition date, House prepared...
-
Green Trifle Bakery discovered some errors for 2020 and 2021. What would be the impact on net income for each year if the errors were left undetected? Error Ending inventory in 2020 2020 2021 was...
-
Use function to write a program that prints all prime numbers in a range of a user input numbers. a. Draw a flow chart for the function IsaPrimenumber b. Draw a flow chart for the whole scenario c....
-
Put all of the below items in the correct format. Don't be concerned about numbers. Just get the lines and headings all in the right places. Beginning Cash Balance CASH FLOWS FROM FINANCING...
-
Visit any social media site with news stories that includes a photograph/snapshot of story (mandatory) . Choose ONE news story. Use the questions below to help you determine validity of that ONE news...
-
The Illinois State University Alumni Association is having two Baseball Day events this year. The purpose of the events is to both foster relationships between ISU alums and to also raise money for...
-
1 YOUR NAME: 2 Asset # 3 Asset name: 4 Date acquired: 5 Cost: 6 Depreciation method: 7 Salvage (residual) value: 8 Estimated useful life (years): 9 222 Computer 1/1/2018 $50,000 Straight Line (SL)...
-
(a) (b) An aircraft is flying straight and level over horizontal ground at a height of 500 m and speed of 300 km/hour. The pilot releases a payload at time t = 0. Assuming the flight of the payload...
-
Write a paper about the compensation of the employees. The approximate cost of advertising for the position of executive director the executive director is responsible for the daily operation of the...
-
Briefly describe the following types of group life insurance plans: a. Group term life insurance b. Group accidental death and dismemberment insurance (AD&D) c. Group universal life insurance d....
-
You need to understand the approach described in question 3 in More Genetic TIPS before answering this question. A gene that is normally expressed in pancreatic cells was cloned and then subjected to...
-
Many researchers are interested in the transcription of protein-encoding genes in eukaryotes. Such researchers want to study mRNA. One method that is used to isolate mRNA is column chromatography....
-
The type of model building used by Pauling and by Watson and Crick involved the use of ball-and-stick units. Model building can now be done with computer software. Even though you may not be familiar...
Study smarter with the SolutionInn App