QuestionQuestion

Transcribed TextTranscribed Text

Assignment 1 Program Description Develop a Console Application that stores the employee id, name and the dollar value of sales made by all the salespeople in a company and calculates the average and standard deviation of the sales amounts. It also prints the id and name of the employee(s) who made the maximum sales. Suppose there are 7 employees in the company and their ids, names, and sales amount are: Employee Id Employee Name Sales Amount 123 Jack $500.50 451 John $155.00 178 Jill $475.75 620 Mary $100.50 177 Peter $500.50 254 Bob $75.00 515 Nancy $275.99 To implement the above application 1. Create a new project called A1_YourLastNameYourFirstName. Make sure that you use the first and last name as they appear in Canvas. Do not use nick names or short form of your names. Not following these naming convention for the project name will result in loss of points. 2. Add a method called CalculateMax that will take an array of doubles as parameter and return the maximum of the array elements. 3. Add a method called CalculateStatistics that will take an array of doubles as parameter and “return” the average and standard deviation of the array elements. You may add additional parameters, but only if necessary. 4. In the Main method: a. Create an array of integers and store the employee ids listed in the table above. b. Create an array of appropriate type and store the employee names listed in the table above. c. Create an array of appropriate type and store sales amounts listed in the table above. d. Call the CalculateStatistics method defined as above to calculate the average and standard deviation of the sales amount values. e. Call the CalculateMax method defined as above to calculate the max of the sales amount values. f. Find the name(s) of the employees with maximum sales amount. g. display all the information in the format as shown in the sample output below. Sample Output Notes: 1. Your output should look exactly like sample output above except that you do not have to have the same amount of spacing between columns as shown in the sample output above. But make sure that (1) the columns are well separated, (2) the values in the first two columns are left aligned and the values in the third column are right aligned, and (3) all the decimal values are displayed with exactly two digits after the decimal point. 2. We may open your source code and change the values in the arrays storing the employee ids, names, and sales amounts when we test your application. We will not change the size of the arrays though. So, write your code in such a way that it will work for any values in the arrays. Please do not write the code to prompt the user to enter these values

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

drop schema if exists ;
create schema ;
use ;


drop table if exists WorksFor ;
drop table if exists Manages ;
drop table if exists Employee ;
drop table if exists Department ;

create table Employee (
eid int not null AUTO_INCREMENT,
name varchar(20),
age int,
salary float,
residenceState char(2),
startDate date,
Primary Key (eid) ) ;

create table Department (
did int not null AUTO_INCREMENT,
name varchar(20),
floor int,
supplyBudget float,
stateLocated char(2),
PRIMARY KEY (did) ) ;

create table WorksFor (
eid int,
did int,
startDate date,
PRIMARY KEY (did,eid),
Foreign Key (did) references Department(did),
Foreign Key (eid) references Employee(eid) ) ;

create table Manages (
eid int,
did int,
dateStartedManaging date,
PRIMARY KEY (did,eid),
Foreign Key (did) references Department(did),
Foreign Key (eid) references Employee(eid) ) ;

insert into Employee values(1,'Sally1',55,24588,'DE','2017-10-7');
insert into Employee values(2,'Sally2',24,44434,'CT','2017-11-21');
insert into Employee values(3,'Sally3',39,58473,'DE','2017-4-3');
insert into Employee values(4,'Sally4',54,45592,'AZ','2017-1-6');
insert into Employee values(5,'Sally5',46,20332,'AL','2017-12-19');
insert into Employee values(6,'Sally6',29,65298,'AZ','2017-10-3');
insert into Employee values(7,'Sally7',25,22854,'AL','2017-11-12');
insert into Employee values(8,'Sally8',25,42689,'AL','2017-4-15');
insert into Employee values(9,'Sally9',35,76660,'DE','2017-10-26');
insert into Employee values(10,'Sally10',62,64220,'FL','2017-5-6');
insert into Employee values(11,'Sally11',22,62333,'CT','2017-4-17');
insert into Employee values(12,'Sally12',65,33358,'GA','2017-9-5');
insert into Employee values(13,'Sally13',20,56151,'CT','2017-4-27');
insert into Employee values(14,'Sally14',66,77908,'CA','2017-6-1');
insert into Employee values(15,'Sally15',29,37716,'CO','2017-11-7');
insert into Employee values(16,'Sally16',57,47192,'AK','2017-10-22');
insert into Employee values(17,'Sally17',58,25562,'AK','2017-1-2');
insert into Employee values(18,'Sally18',39,66379,'CO','2017-8-3');
insert into Employee values(19,'Sally19',37,28526,'CA','2017-5-26');
insert into Employee values(20,'Sally20',45,37101,'AK','2017-9-27');
insert into Employee values(21,'Sally21',44,53232,'CA','2017-8-19');
insert into Employee values(22,'Sally22',44,31508,'AZ','2017-4-16');
insert into Employee values(23,'Sally23',37,48180,'AK','2017-6-10');
insert into Employee values(24,'Sally24',36,71377,'CO','2017-11-14');
insert into Employee values(25,'Sally25',28,41203,'AL','2017-5-1');
insert into Employee values(26,'Sally26',66,29621,'GA','2017-3-16');
insert into Employee values(27,'Sally27',48,58271,'AL','2017-2-20');
insert into Employee values(28,'Sally28',26,64864,'AK','2017-1-5');
insert into Employee values(29,'Sally29',58,72028,'AK','2017-11-4');
insert into Employee values(30,'Sally30',60,62679,'CO','2017-5-16');
insert into Employee values(31,'Sally31',64,31842,'AZ','2017-6-6');
insert into Employee values(32,'Sally32',45,62157,'CA','2017-12-6');
insert into Employee values(33,'Sally33',69,69156,'DE','2017-2-24');
insert into Employee values(34,'Sally34',66,32891,'CT','2017-9-28');
insert into Employee values(35,'Sally35',47,52308,'AZ','2017-8-1');
insert into Employee values(36,'Sally36',40,73770,'GA','2017-12-5');
insert into Employee values(37,'Sally37',60,60340,'CO','2017-7-3');
insert into Employee values(38,'Sally38',57,51528,'GA','2017-7-24');
insert into Employee values(39,'Sally39',61,23260,'FL','2017-6-18');
insert into Employee values(40,'Sally40',52,62181,'CO','2017-6-23');
insert into Employee values(41,'Sally41',66,65607,'AZ','2017-7-11');
insert into Employee values(42,'Sally42',37,69732,'DE','2017-3-14');
insert into Employee values(43,'Sally43',64,43991,'CT','2017-4-17');
insert into Employee values(44,'Sally44',68,63883,'AZ','2017-11-5');
insert into Employee values(45,'Sally45',24,73889,'GA','2017-9-5');
insert into Employee values(46,'Sally46',28,69150,'CT','2017-8-25');
insert into Employee values(47,'Sally47',36,76675,'AL','2017-9-15');
insert into Employee values(48,'Sally48',39,52939,'FL','2017-1-19');
insert into Employee values(49,'Sally49',61,35239,'FL','2017-10-18');
insert into Employee values(50,'Sally50',68,33958,'AZ','2017-1-12');
insert into Employee values(51,'Sally51',59,52911,'GA','2017-11-5');
insert into Employee values(52,'Sally52',54,65561,'AZ','2017-12-22');
insert into Employee values(53,'Sally53',35,43134,'CT','2017-11-4');
insert into Employee values(54,'Sally54',35,73498,'DE','2017-7-4');
insert into Employee values(55,'Sally55',23,38842,'AL','2017-4-14');
insert into Employee values(56,'Sally56',30,43405,'AZ','2017-9-22');
insert into Employee values(57,'Sally57',26,69153,'FL','2017-6-13');
insert into Employee values(58,'Sally58',23,25885,'GA','2017-1-23');
insert into Employee values(59,'Sally59',61,45608,'CA','2017-5-13');
insert into Employee values(60,'Sally60',41,76776,'GA','2017-4-2');
insert into Employee values(61,'Sally61',64,35610,'CO','2017-9-4');
insert into Employee values(62,'Sally62',25,58021,'AL','2017-9-22');
insert into Employee values(63,'Sally63',65,39524,'GA','2017-6-8');
insert into Employee values(64,'Sally64',28,68306,'CT','2017-12-7');
insert into Employee values(65,'Sally65',36,43778,'FL','2017-12-12');
insert into Employee values(66,'Sally66',23,49969,'GA','2017-4-26');
insert into Employee values(67,'Sally67',22,76527,'AZ','2017-8-2');
insert into Employee values(68,'Sally68',59,75266,'AZ','2017-1-15');
insert into Employee values(69,'Sally69',25,79477,'AZ','2017-11-11');
insert into Employee values(70,'Sally70',69,50486,'CA','2017-9-23');
insert into Employee values(71,'Sally71',23,51367,'AZ','2017-11-20');
insert into Employee values(72,'Sally72',69,54555,'DE','2017-6-17');
insert into Employee values(73,'Sally73',35,65773,'DE','2017-8-23');
insert into Employee values(74,'Sally74',52,29268,'CO','2017-6-6');
insert into Employee values(75,'Sally75',39,38900,'CT','2017-8-9');
insert into Employee values(76,'Sally76',42,28815,'DE','2017-12-14');
insert into Employee values(77,'Sally77',41,65856,'AZ','2017-7-28');
insert into Employee values(78,'Sally78',26,67849,'FL','2017-12-1');
insert into Employee values(79,'Sally79',67,57613,'CA','2017-4-3');
insert into Employee values(80,'Sally80',39,59010,'GA','2017-3-12');
insert into Employee values(81,'Sally81',24,30836,'AZ','2017-2-18');
insert into Employee values(82,'Sally82',60,36161,'AZ','2017-1-21');
insert into Employee values(83,'Sally83',28,77224,'DE','2017-7-26');
insert into Employee values(84,'Sally84',60,60173,'GA','2017-8-28');
insert into Employee values(85,'Sally85',21,41759,'CA','2017-9-14');
insert into Employee values(86,'Sally86',31,56840,'CA','2017-1-19');
insert into Employee values(87,'Sally87',32,51423,'FL','2017-10-19');
insert into Employee values(88,'Sally88',64,54845,'CO','2017-8-27');
insert into Employee values(89,'Sally89',63,29884,'FL','2017-12-22');
insert into Employee values(90,'Sally90',57,21918,'FL','2017-10-10');
insert into Employee values(91,'Sally91',23,38846,'CT','2017-4-5');
insert into Employee values(92,'Sally92',20,79224,'DE','2017-12-21');
insert into Employee values(93,'Sally93',51,23912,'AK','2017-3-22');
insert into Employee values(94,'Sally94',20,70022,'CO','2017-1-9');
insert into Employee values(95,'Sally95',29,50090,'CO','2017-4-1');
insert into Employee values(96,'Sally96',37,53276,'AK','2017-10-17');
insert into Employee values(97,'Sally97',53,47868,'AZ','2017-8-2');...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$20.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats