Question
JavaScript Given an input sequence of various fish in the sea, display the total weight of each fish. The format of the input and the
JavaScript
Given an input sequence of various fish in the sea, display the total weight of each fish. The format of the input and the output is shown below. Each number refers to the weight of an individual fish in ounces. There could be any number of fish and any number of types of fish in the input.
Input: Tigerfish 13.2, 4.7, 9.2, 11.1; Clownfish, 2.1,3.5,6.4; Catfish, 12.3,14.6,11.7
Output: Tigerfish: # of fish: 4 | Total Weight: 38.2
Clownfish: # of fish: 3 | Total Weight: 12
Catfish: # of fish: 3 | Total Weight: 38.6
Only use prompt() and and document.writeln() for I/O.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started