Task 1 -C++ programming We need to be able to get data into the C++ program so we can work on it, so you need to write a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Task 1 -C++ programming We need to be able to get data into the C++ program so we can work on it, so you need to write a

Post by answerhappygod »

Task 1 C Programming We Need To Be Able To Get Data Into The C Program So We Can Work On It So You Need To Write A 1
Task 1 C Programming We Need To Be Able To Get Data Into The C Program So We Can Work On It So You Need To Write A 1 (232.33 KiB) Viewed 30 times
Task 1 – C++ programming
We need to be able to get data into the C++ program so we can
work on it, so you need to write a program, to read in data a file
and store that data in a vector or vector of pointers I recommend
you use a class to store the data similar to the taxpayer tute but
as long as its in vectors in some way its fine.
To demonstrate you have read the data, it needs to be displayed
on a console in short form and also counted and the numeric columns
totalled so you can prove the complete file is read. This is the R,
C and L options in the menu
The data is comma separated and in the following format, Numbers
have a dot to separate cents if the. is missing you can assume .00
cents. There may be leading or trailing blanks on any field that
should be ignored. Lines starting with / should be ignored, or if
you want you can edit the file and delete them. Lines can have a
trailing comma which can be ignored.
Data name
Type
Maximum length
Example
Notes
id
Text
8
10010003
honorific
Text
4
Miss
First name
Text
Unknown
Simon
Second name
Text
Unknown
Zellweger
Company Name
Text
Unknown
Emerson Exhibitions Ltd
Current salesperson
text
8
See below
Value of purchases
Dollars and cents
9,999,999.00
21016.22
Format with decimal point
List of previous sales staff
text
Unknown
Janet:Nell:
See NOTE1
Value of commissions
Dollars and cents
9999999.00
0.0
Format with decimal point
List of Possible salespeople (conveniently in c++):
string salesStaff[] = {"Brad", "Janet", "Dr Scott", "Rifraf",
"Nell", "Eddie"};
NOTE1: This is a : separated list of previous sales staff. This
field was maintained in a comment field in the old system and staff
were trained to put it in; even if there was no change in
salesperson. Therefore its possible the same person appears in
there twice. The good news is that Rose Thompson, went through all
the comment fields and removed non sales person comments late in
the weekend that the IT staff did the conversion. So I am assured
that no rubbish is in this field. I recommended Rose for employee
of the month for the heroic efforts she made for the IT team on
that difficult weekend.
This is a sample of the data file to help you understand the
problems.
10020564,Mr,Raymond,Nash,Nash Publishing Ltd,Dr
Scott,9400.000000,,921.200000,
10010565,Miss,Tammy,Smithers,Smithers Cameras
Ltd,Janet,2028.000000,,198.744000,
10040566,Mr,Malcolm,Ramsey,Ramsey Beauty Treatments
Ltd,Nell,7170.000000,,702.660000,
10000567,Ms,Anthea,Jarvis,Phoenix Supplements
Ltd,Brad,452.000000,,45.200000,
10030568,Mr,Darryl,North,North Gourmet Foods
Ltd,Rifraf,4187.000000,check child care,418.700000,
10030569,Mrs,Becky,Moran,Moran Machinery
Ltd,Rifraf,2859.000000,,265.887000,
10050570,Mr,Dale,Sylvester,Sylvester Coverings
Ltd,Eddie,724.000000,,70.952000,
10020571,Ms,Angela,Farrell,Farrell Recycling Ltd,Dr
Scott,1134.000000,,105.462000,
10050572,Mr,Ronald,Newport,Newport Paper Products
Ltd,Eddie,7375.000000,,737.500000,
10040573,Ms,Bethany,Desborough,Hillside Technologies
Ltd,Nell,6498.000000,,649.800000,
10030574,Mr,Jerry,Mallard,County Kitchens
Ltd,Rifraf,3118.000000,,311.800000,
10030575,Ms,Lauryn,Dee,Dee Cakes
Ltd,Rifraf,327.000000,,32.046000,
10000577,Mr,Donald,Hamill,Hamill Design
Ltd,Brad,27.000000,,2.646000,
10000578,Miss,Una,Xanda,Xanda Exhibitions
Ltd,Brad,3046.000000,,298.508000,
10000579,Mr,Eric,Foley,Foley Machinery
Ltd,Brad,1580.000000,,154.840000,
10030580,Mrs,Janice,Renley,Renley Fixings
Ltd,Rifraf,1762.000000,,176.200000,
I supply the following Files
File
Purpose
Notes
NamesdataA1TxtTst.txt
Straightforward test file of 17 records
NamesdataA1Txt.txt
Straightforward test file of 1110 records
NamesdataA2Txt.txt
The file you need to process when evidencing testing
NamesdataA1TxtDupId.txt
Test file with at least 1 duplicated id for your testing
NamesdataA1TxtFraud.txt
Test file with at least 1 fraudulent for your testing
customer/sales person
NamesdataA1TxtBadData.txt
Test file with at least 1 example of bad previous sales person
data for your testing
Some files may have a trailing empty like your program should
deal with this without crashing.
My read file option menu uses a dir variable to set directories:
See the code fragments I provide and the screenshot of my read
option for details on how this works.
I use a menu to control the program, The menu shows the current
file being processed, and has the options shown below. In truth I
also added a show option that shows all details of the read in data
– which I needed for debugging – that is not assessed but you may
add additional options for testing/debugging without fear of
penalty.
Assign1 2022 Menu
-----------------
E(xit) - Exit
R(ead) - Read File
C(heck) - Check File details
L(ist) - List in short form for checking
F(raud) - Search for sales fraud
A(udit) - Audit for rubish entries in previous sales
people
D(uplicates) - Find and list duplicate id numbers
SO(rt) - Sort on account number
Task 1 -C++ programming We need to be able to get data into the C++ program so we can work on it, so you need to write a Ca program, to read in data a file and store that data in a vector or vector of pointers I recommend you 1 use a class to store the data similar to the taxpayer tute but as long as its in vectors in some way its fine. To demonstrate you have read the data, it needs to be displayed on a console in short form and also counted and the numeric columns totalled so you can prove the complete file is read. This is the R, and Loptions in the menu The data is comma separated and in the following format, Numbers have a dot to separate cents if the. is missing you can assume.00 cents. There may be leading or trailing blanks on any field that should be ignored. Lines starting with should be ignored, or if you want you can edit the file and delete them. Lines can have a trailing comma which can be ignored. Data name Type Maximum Example Notes length id Text 8 10010003 honorific Text 4 Miss First name Text Unknown Simon Second name Text Unknown Zellweger Company Text Unknown Emerson Exhibitions Ltd Name Current text See below salesperson Value of Dollars and 9.999,999.00 2101622 Format with decimal purchases cents point List of previous text Unknown Janet Nell See NOTE: sales statt Value of Dollars and 9999999.00 0.0 Format with decimal commissions cents point List of Possible salespeople conveniently in coe): C string salesStaBrad", "Janet', 'DrScore',"ifraf, 'Nell',"Eddie NOTE1: This is a separated list of previous sales staff. This field was maintained in a comment field in the old system and staff were trained to put it in; even if there was no change in salesperson. Therefore its possible the same person appears in there twice. The good news is that Rose Thompson, went through all the comment fields and removed non sales person comments late in the weekend that the IT staff did the conversion. So I am assured that no rubbish is in this field. I recommended Rose for employee of the month for the heroic efforts she made for the IT team on that difficult weekend. . This is a sample of the data file to help you understand the problems. 10020564, Mr, Raymond, Nash Nash Publishing Ltd, Dr Scott, 9400.000000,921 200000, 10010565, Miss, Tammy, Smithers, Smithers Cameras Ltd, Janet 2028.000000,198.744000, 10040566, Mr, Malcolm, Ramsey, Ramsey Beauty Treatments Ltd, Nell, 7170.000000,702.660000, 10000567, Ms, Anthea, Jarvis Phoenix Supplements Ltd, Brad 452.000000, 45.200000, 10030568, Mr Darryl North North Gourmet Foods Ltd, Rifraf 4157.000000 check child care, 418.700000 10030569, Mrs, Becky, Moran, Moran Machinery Ltd, Rifraf,2859.000000, 265.887000, 10050570, Mr, Dale, Sylvester Sylvester Coverings Ltd, Eddie,724.000000,70.952000, 10020571, Ms Angela, Farrell,Farrell Recycling Ltd, Dr Scott,1134.000000,105.462000, 10050572, Mr, Ronald, Newport, Newport Paper Products Ltd, Eddie 7375.000000,737.500000, 104578 Ms Rethany Decharh Hillside Technologies Neil Ronn 40 80
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply