Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write C++ program that calculates the intensity of light onto a NBA basketball court. A standard NBA basketball court is 94 feet long and

image
image

Write C++ program that calculates the intensity of light onto a NBA basketball court. A standard NBA basketball court is 94 feet long and 50 feet wide. We will assume that every square foot is represented by a cell in a two-dimensional array (or matrix). Given certain criteria that you read in from a data file, you will need to calculate the intensity of light at each square foot of the court. Your program must have the following 4 functions: A. Calculate the intensity of light (see formulas below) B. Calculate the distance from the light to the floor C. Random number generator D. Print out the results Formulas: Fc=Cp/(D^2) D= sqrt(b^2+h^2) Where: Fc = is the level of light the candle (floodlight) produces D = the distance the lamp is from the surface Cp = the candle power of the lamp (in watts) Use the second formula to calculate the distance (D) from the light to each position (cell) on the basketball court. Criteria/Data File: A data file called lights.txt is available on Canvas with the following data and in this order: o Option letter (to be echoed back out) o Number of floodlights installed o Character to determine if the measurements are (G)iven or (R)andom. (If random then you need to randomly produce the position of are (G)iven or (R)andom. (If random then you need to randomly produce the position of that number of floodlights.) o For each given floodlight, the number of feet across the court (in the 50' direction) then the number of feet (in the 94' direction) o Power of the floodlights in watts o Distance (feet) the lights are mounted above the position N222UNAN NAND 2 G 25 55 25 400 20 B G 25 C3R 55 25 1000 30 400 35 23.5 70.5 23.5 70.5

Step by Step Solution

3.36 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Here is an example C program that calculates the intensity of light onto a NBA basketball court based on the given criteria in the data file Note that ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Physics

Authors: Paul G. Hewitt

11th edition

321568095, 9780-032166256, 321662563, 978-0321568090

More Books

Students also viewed these Programming questions

Question

What arguments can be advanced in favour of variable costing?

Answered: 1 week ago

Question

=+1. Which of the given are Actions and which are States of Nature?

Answered: 1 week ago