Problem Solving and Programming in C++

Assignment #6 Problem Solving and Programming in C++ Department of Computer Science Old Dominion University Objectives: The software testing process (i.e., the BBT) consumes large amounts of data. Creating the test data is a crucial part of the testing process especially for new systems which are not in use yet. This assignment will give you an opportunity to practice creating representative test data. After completing this assignment, students will be able to:  Create random data from a given set of parameters  Create a large number of test cases to test all possibilities  Write a C++ program to process the data as though it were collected from a real situation. This assignment will be submitted into two parts (Part-A and Part-B) – a separate Code::Blocks project is required for each part. Problem description: A large company that sells high end furniture needs a program to help calculate their year end bonuses. For each of their 5000 employees, a percentage of their total sales amount minus the minimum total sales amount (taken from the employee with the lowest number of furniture sales) is multiplied by a percentage of their salary. This is their year end bonus, and employees count on this to be calculated accurately, since it can easily double their salary if they have a high sale volume. Part-A: Write a C++ program to generate the data file “data.txt”. Each line in this file represents an employee record, with each element separated by a comma which includes the: empID, firstname, lastname, storeID, salary, daysWorked As shown below for one employee: 100002, ozyomoimmtplme, tpvcrdfrowjnfur, 3549, 44442, 225, The record above is just an example of one employee, remember there are 5000 employees. The text file should be sorted with the lowest empID first. Use an array of struct for the creation of the employees. Please note that the empID is a unique 6 digit number. You should use a random number generator to generate a unique ID for each employee. This should be accomplished within a stand alone function called genID() which also checks to make sure the ID is unique within the array of 5000 employees. The fact that this function accesses the entire array is part of why it is a standalone function and not a member function of the struct employee. For each employee you must randomly generate:  A unique empID of 6 digits.  A first name and a last name, (not unique) of random length between 8 and 16 characters, made up of random chars. This can be stored in separate variables or within its own struct A store ID (not unique) of 4 digits.  A salary between 20,000 and 100,000(inclusive).  Days Worked, 0-21 (inclusive) days for each month, for 12 months out of the year. The sum of days worked for all months will be stored in the file.  Sales total for each day worked in a month are added to the monthly Sales Total. Monthly totals are separated by spaces o This can be stored in a single string o Sales should be higher for employees with higher salaries:  Salaries<60000 , daily sales should be from 1000-15000 a day(for each day worked)  Salaries>60000, daily sales should be from 3000-20000 a day(for each day worked) o A line of output, including Monthly Sales Totals, should look like this: 100001, wtfxltnqbkviye, zhajstwyxcaptn, 9572, 52173, 123, 25908 0 92106 77831 41707 109114 26283 5399 149521 139501 108583 57303 All on one line in a text file. The total sales for each of the 12 months should be separated by a space, while the other items in the row should be separated by commas. Other Functions for Part A:  A Boolean member function which compares the empID of this instance of employee with another instance of employee passed as a parameter. Returns true if this.empID > another.empID .  A print member function which prints the contents of this instance of employee in the format given above to an outstream.  A standalone function which sorts the array by ID, using the member comparison function. Places the lowest ID number at the top of the Array (should be printed first in the file)  A standalone function which prints out the employee array to file, calling the employee.print() function for each array member. The resulting text file should contain 5000 employees, each on its own line, and all of their data. The employees should be sorted with lowest ID at the top of the file. ALL DATA SHOULD BE RANDOMLY GENERATED. Be sure that srand() is only being called once, so that the random number sequence doesn’t restart over and over. Submission notes for Part-A:  Zip the Code::Blocks project containing all the .cpp, .h, .cbp files and name the zipped file “Assg6A_cslogin.zip”, where the cslogin is your login ID for the computers at the Department of Computer Science at ODU. You can exclude the bin and debug folders.  You do not have to submit the txt file (data.txt) with your program for Part-A. This file will be deleted when the graders test your program.  Submit the zipped file using the appropriate Blackboard link. Part-B:Create a new project in Code Blocks. Write a C++ program which reads the “data.txt” you created in Part A using the appropriate data structure to manage the employee data. For each employee, read in the dailySales, summing as you go, and store it as a member variable double totalSales. Once the employees have been read in, find the minimum dollar amount of totalSales by any employee, and then calculate the bonus amount for each employee in the Array using the following formula: (0.001 ∗ ) ∗ (0.001 ∗ ( − ) Sort the Array using a standalone function based on totalSales(using a member comparison function), with highest sales at the Top. Output the sorted array to “results.txt”. Create a function called “printReport” which calculates and appends the following report to the “results.txt” file.  Top 10 Highest Sales empID: totalSales:  Bottom 10 lowest Sales empID: totalSales:  Average Sales across the company:  Total Sales Overall:  Total Bonuses Overall: A sample “results.txt” file will be made available in the assignment folder. Submission notes for Part-B:  Zip the Code::Blocks project containing all the .cpp, .h, .cbp files along with the txt files and name the zipped file “Assg6B_cslogin.zip”, where the cslogin is your login ID for the computers at the Department of Computer Science at ODU. You can exclude the bin and debug folders.  You must submit the txt file (data.txt) that was created in you Part-A with your program for Part-B. This file is required for grading your assignment.  Submit the zipped file using the appropriate Blackboard link.

Fountain Writers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.