Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must print your name and the date at the bottom of the report. All columins MUST align properly and neatly and you MUST match your

Must print your name and the date at the bottom of the report.
All columins MUST align properly and neatly and you MUST match your outpu
the one shown below for full credit.
Here is a screen dump of a full simulation of the program
A manufacturer promotes an electric generator worldwide. The suggested sales price of the
generator being promoted is different in each country they promote the machine. The machine is
sold thru an agent in each county. Raw sales details such as county name, agent name, units
sold and price per unit for each county is given to you in a file named
generatorSalesDetails.dat. Shown below is a prototype of the file.
USA, Foxtail Inc, 257,1429.00
UK, Ignite Tech, 112,1830.23
Germany, Synchro Studio, 227,1457.28
Finland, Think Tank, 320,1389.34
Australia, Raptor, 88,1600.17
...............
Each row in the file is a comma separated list where
the data are in the order of country name, agent
name, units sold and price per unit.
Write a PowerShell script that opens and reads the file generatorSalesDetails.dat line by line
and then calculates and prints Country, Agent Name, Units Projected, Units Sold,
Difference, Price Per Unit, Total Sales, Expected Sales. Note that the Units
Projected are given to you in a separate array (and IT IS NOT a part of the data file. Do not
insert them into the file). The Units projected to be sold are given below in that order
(matching the countries order in the file)
500,180,300,250,300,100,140,230,150,150,220,200,150,150,100,200,200,300,200,140,250,150,80,80
Your output titles should look like the following,
Worldwide Equipment Makers and Distributors
Year ending 2023
Vear ending 2023
Country
Agent Name
Units Projected
Difference
Price Per Unit
Total Sales Expected Sales
You must match these criteria for full credit.
DO NOT alter the given data file
Output MUST have a title and column headings as shown above
All printed floating point number columns must have 2 decimal places.
'Difference', 'Total Sales' and 'Expected Sales' columns are calculated as:
Difference = Units Sold - Units Projected
Total Sales = Units Sold ** Price Per Unit
Expected Sales = Units Projected * Price Per Unit
In Grand Totals row, the 'Total Sales' and 'Expected Sales' must have a $ sign.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago