Write a program that creates a tool box object that contains two(2) different tools, each with varying speeds. class Tools (1) A array of five(5) doubles with the initial values 7000.55, 5017.34, 9789.23, 6912.45, 345.12. This represents the initial varying speeds of the tools. (2) Method setSpeed. This contains two parameters. The first parameter is of type double and the second is of type int. If the value of the second parameter is 100, multiply each array element by the first parameter, otherwise divide each array element by the first parameter. (3) Method displaySpeed.  This displays all the array elements.   class ToolBox (1) Objects T1 and T2 of type Tools. (2) Method toolsInfo. This method contains two (2) parameters that are the same with setSpeed. If the value of the second parameter is 100, set first the new speeds for T1 and then display the new speeds, otherwise set first the new speeds for T2 and then display the new speeds.   class try  (1) one object of type ToolBox (2) object.toolsInfo(1.2, 100); object.toolsInfo(3.5, 2); object.toolsInfo(4.2, 17);

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a program that creates a tool box object that contains two(2) different tools, each with varying speeds.

class Tools

(1) A array of five(5) doubles with the initial values 7000.55, 5017.34, 9789.23, 6912.45, 345.12. This represents the initial varying speeds of the tools.

(2) Method setSpeed. This contains two parameters. The first parameter is of type double and the second is of type int. If the value of the second parameter is 100, multiply each array element by the first parameter, otherwise divide each array element by the first parameter.

(3) Method displaySpeed.  This displays all the array elements.

 

class ToolBox

(1) Objects T1 and T2 of type Tools.

(2) Method toolsInfo. This method contains two (2) parameters that are the same with setSpeed. If the value of the second parameter is 100, set first the new speeds for T1 and then display the new speeds, otherwise set first the new speeds for T2 and then display the new speeds.

 

class try 

(1) one object of type ToolBox

(2) object.toolsInfo(1.2, 100); object.toolsInfo(3.5, 2); object.toolsInfo(4.2, 17);

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY