Question: Please solve with C++ Question 5 ( 20 marks ) Newer light bulbs are designed to use less energy, produce less heat and yet produces

Please solve with C++

Please solve with C++ Question 5 ( 20 marks ) Newer light

Question 5 ( 20 marks ) Newer light bulbs are designed to use less energy, produce less heat and yet produces same level of brightness. A file named "lights.txt" contains different set of lights and their watt's electric consumption (max 200 records). Each line in the file consists of light type(string), its energy consumption in Watts (int) and its brightness level in lumens (int). Write a program that reads the data from file into 3 parallel arrays. Your program will perform the followings (see sample file and screen output below): 1. Calculate how many Halogen and LED lights found in file. 2. Calculate the average Watts for all LED lights found. 3. Display ail lights and their Watts below average calculated in step 2. 4. Display the most efficient light bulb (highest efficiency). Efficiency is measured as the amount of lumens divided by Watts. 5. Follow sample Screen output given below. lights.txt { tput file) Sample Screen Output Halogen: 20 LED: 27 Average Watts for LEDs: 16.7 LED Halogen LED LED Halogen 18 15 9 22 25 500 250 700 2000 1500 Light Watts Halogen LED 15 9 bulb is LED 22 2000 Most efficient light with efficiency of 90.9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!