Write a Java program that reads items of two vectors and applies the below given function...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that reads items of two vectors and applies the below given function over those vectors. f(x, y) = 2x + 3y Program should continue until user enters 0 for the size of the vectors. Analyze sample output and write your codes accordingly. Size of the vectors: 3 First vector (x): 2 5 10 Second vector (y): 1 3 1 Result: [7 19 23] Size of the vectors: 2 First vector (x): 20 Second vector (y): 1 5 Result: [7 15] Size of the vectors: 4 First vector (x): 2 50 4 Second vector (y): 6 1 3 5 Result: [22 13 9 23] Size of the vectors: 0 Bye! Write a Java program that reads items of two vectors and applies the below given function over those vectors. f(x, y) = 2x + 3y Program should continue until user enters 0 for the size of the vectors. Analyze sample output and write your codes accordingly. Size of the vectors: 3 First vector (x): 2 5 10 Second vector (y): 1 3 1 Result: [7 19 23] Size of the vectors: 2 First vector (x): 20 Second vector (y): 1 5 Result: [7 15] Size of the vectors: 4 First vector (x): 2 50 4 Second vector (y): 6 1 3 5 Result: [22 13 9 23] Size of the vectors: 0 Bye!
Expert Answer:
Answer rating: 100% (QA)
Following code does the desired task import javautilScanner class CalVec public static void mainStr... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these computer network questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Jones Archaeology began 2018 with retained earnings of $180,000. During 2018, Jones made sales of $832,000 with 56% of sales allocated to cost of goods sold. Selling and administrative expense for...
-
A four-cylinder, four-stroke, 2.8-liter modern, high-speed compression-ignition engine operates on the ideal dual cycle with a compression ratio of 14. The air is at 95 kPa and 55C at the beginning...
-
The mass m in Figure is attached to a rigid rod having inertia I about the pivot and negligible pivot friction. The input is the displacement z. When z = θ = 0, the spring is at its free...
-
If you were trying to examine this issue, how would you proceed? Any suggestions for me to take next steps? same. Is that what happened? You normally wouldnt borrow money from the company, would you?
-
Wiset Company completes these transactions during April of the current year (the terms of all its credit sales are 2/10, n/30). Apr. 2 Purchased $ 14,300 of merchandise on credit from Noth Company,...
-
Write a three page paper on Compare and contrast Online Analytic Processing (OLAP) and Online Transaction Processing (OLTP); also discuss Codds rules for TP databases and OLAP databases. Cite any...
-
The Garden Ornament Company manufactures two types of garden ornament a duck and a heron The information presented in Tables T1 to T5 has been prepared as a result of discussions by line managers for...
-
Why log mean temperature difference is not used in single pass heat exchanger.
-
Identify the main levers to deal with uncertainty in a supply chain.
-
Should uncertainty be considered when planning supply chain networks? Why or why not?
-
Discuss the following proposition with reference to an automobile garage that handles maintenance and repair: Modal choice decisions could improve the responsiveness of the supply chain performance.
-
Describe how a company achieves strategic fit between its supply chain strategy and its competitive strategy.
-
Discuss the strengths and weaknesses of various distribution options.
-
John owns all the shares of Blue Corporation. John wishes to sell the corporation and agrees to pay an outside agency $80,000 to determine the fair value of the corporation and to assist him in...
-
Consider the circuit of Fig. 7.97. Find v0 (t) if i(0) = 2 A and v(t) = 0. 1 3 ett)
-
Create an application that calculates the registration fees for a conference. The general conference registration fee is $895 per person, and student registration is $495 per person. There is also an...
-
How do you retrieve the selected item from a JComboBox component? How do you get the index of the selected item?
-
What happens in Java when a program tries to use a subscript that is out of bounds?
-
The plaintiff [Christine Parent] leased an automobile from Amity Autoworld, Ltd. (hereafter Amity) [in Amityville, New York] in January 2002. Amity sold all its Toyota automobile franchise assets * *...
-
PT China, LLC, joined with PT Korea, LLC, to form PT Holdings. Harrison Wang and Michael Kim, representing the two entities, were to be the managers. The agreements prohibited them from engaging in...
-
The Communications Act of 1934 established a system of limited-term broadcast licenses subject to various conditions * * * . * * * [These conditions include] the indecency banthe statutory...
Study smarter with the SolutionInn App