GetACoder.com

 
 

Home | My Account | Post Job | Browse Jobs | RSS Feeds | Careers New!

 

Lottery

 
 
     
Job Summary:
 
Job Type: Project
Budget: $ 20-100
Required Skills: C++ / C, Programming
Attached Files: (None)
 
Status: Work Performed (selected user EastWard)
 
Buyer Summary:
 
Username:
nesyou5  
Feedback Score: 10.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/10 2 reviews
Award Reliability: 4 posted 2 paid
 
Location: Orlando, Florida, United States
Member Since: September 3, 2010
 
Invited Users: There are no invited users


Description
Objective
1. To review reading from a file.
2. To use records (an instance of a struct)
3. To create an array dynamically. (array of structs)
4. To use enumerated types in a useful manner.
The Problem
You are hired by the state of Florida to decide who gets winnings for the Florida Lottery. The state has a system that automatically creates a file that contains the name of each ticket purchaser along with the combination of 6 distinct numbers picked by that person. Your job is to use this file in determining everyone\\\\\\\'s winnings. In particular, here is the payout for matching a certain number of values:
Numbers Matched
Winnings
3
\\\\\\\\
4

5
00
6
0000
Your program will ask the user for an input file with the data for the ticket purchases. Then your program will ask the user for the winning combination of numbers. (When playing the Florida lottery, you must pick 6 distinct numbers from the set {1,2,3,...,52,53}.) So 53 is the highest possible number. The user MUST enter these numbers in ascending order. Once these have been entered, your program should print out the names of all the winners, along with how much money they have won. You are guaranteed that each person playing the lottery has bought EXACTLY one ticket and is listed once in the file.
In your implementation please adhere to the following guidelines:
1) Use a record to store information about each ticket.
2) Dynamically allocate an array to store all the ticket information based on the first number in the file.
3) Use an enumerated type for the four possible winning values.
References
Textbook: Chapter 2, 3
Input File Format
The input file your program will take in will have the following format:
The first line will contain a single integer n, the total number of tickets bought.
The next 2n lines will contain information about each ticket bought. The information for a single ticket will be on two lines. The first of the two lines will contain the last name of the ticket buyer, followed by a space, followed by the first name of the ticket buyer. Both the first and last name are guaranteed to be 19 characters or less. The following line will contain the six integers chosen by that buyer all in ascending order separated by spaces.
Here is a sample file, input.txt:
5
Llewellyn Mark
1 15 19 26 33 46
Young Brian
17 19 33 34 46 47
Cazalas Jonathan
1 4 9 16 25 36
Siu Max
17 19 34 46 47 48
Balci Murat
5 10 17 19 34 47
User Input Specification
1. The file name entered will be valid.
2. The winning lottery numbers will be valid and entered in ascending order.
Output Specification
Your output should contain one winner per line. Each line of output should be of the following format:
First Last matched X numbers and won $Y.
where First is the first name of the winner, Last is the last name of the winner, X is the number of winning numbers the player picked correctly, and Y is the prize money won.
Your program MUST adhere to this EXACT format (spacing capitalization, use of dollar signs, periods, punctuation, etc). The graders will use very large input files, resulting in very large output files. As such, the graders will use text comparison programs to compare your output to the correct output. If, for example, you have two spaces between First and Last instead of one space, this will show up as an error even through you may have the program correct. You WILL get points off if this is the case, which is why this is being explained in detail.
Again, your output MUST ADHERE EXACTLY to the line shown above.
Output Samples
Here is one sample output of running the program. Note that this is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given. The user input is given in italics while the program output is in bold. (Note: The following output is based upon the sample input file shown above.)
Enter the name of the file with the ticket data.
input.txt
Enter the winning Lottery numbers
17 19 33 34 46 47
Mark Llewellyn matched 3 numbers and won \\\\\\\\.
Brian Young matched 6 numbers and won 0000.
Max Siu matched 5 numbers and won 00.
Murat Balci matched 4 numbers and won .
Grading Details
Your program will be graded upon the following criteria:
1) Adhering to the implementation specifications listed on the first page.
2) Your algorithmic design.
3) Correctness.
4) Use of Enumerated types for the structs
5) The frequency and utility of the comments in the code, as well as the use of white space for easy readability. (We\\\\\\\'re not kidding here. If your code is poorly commented and spaced and works perfectly, you could earn as low as 80-85% on it.)
6) Compatibility to Dev C++. (If your program does not compile in Dev C++, you will get a sizable deduction from your grade.)
7) Your output MUST adhere to the EXACT FORMAT shown in the
Note: There is a more efficient way to determine the number of matching tickets compared to the straightforward method. No credit will be taken off if you don\\\\\\\'t discover this method, but please do try to look for an efficient solution to this part of the problem.
Restrictions
Name the file you create and turn in lottery.c. Although you may use other compilers, your program must compile and run using Dev C++. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. You should also include comments throughout your code, when appropriate.




Reminder
You may not start working in this and any request before your bid is accepted. Users who violate this policy may have their accounts permanently suspended.



 Bids Received (4)   Shortlist (0)   Declined Bids (0)   
Average bid amount:   $97.50   Average delivery time:   8 Day(s)
Place Bid | Post Similar Job | Send Request | Contact nesyou5

Order by:

 

Remember that contacting the other party outside the site (by email, phone, etc.) on all business jobs (before the request is awarded) is a violation of our terms of use. We supervise all site activity for such infringements and can immediately expel transgressors on the spot, so we thank you in advance for your cooperation. If you notice a violation please help out the site and report it. Thank you for your help.
 

 
send private message
Shortlist
Decline Bid
anigh1982  
kolkata, IN
location
US$300
bid amount

8.64/108.64/108.64/108.64/108.64/108.64/108.64/108.64/108.64/108.64/10
(14 reviews)

feedback
25 day(s)
delivery time

 
 
“SEARCHING FOR THE RIGHT MATCH” we’ve been working in web development industry since last 4 years. We are committed to deliver the highest level consulting and development services. Read your requirement and everything has been understood. We have already delivered a couple of similar projects and given our strong capabilities. I am confident we can deliver a powerful end-result to you as well. Our prime objective is client satisfaction and fulfills their needs with unlimited efforts. WE DO : * work personally with you ; during business hours through the communication means by your choice ; in simple English, to ensure a concise implementation of your satisfaction ; into 100 % W3C compliant and validate ( optional ) clean ; efficient web coding and design. WE DON’T: * talk sweetly and give assurance and give wrong commitments *************pls open gac chat to view portfolio******************
Bid Time: 09-03-2010 04:27
 
send private message
 
EastWard  
Zaporozhye, UA
location
US$30
bid amount

9.58/109.58/109.58/109.58/109.58/109.58/109.58/109.58/109.58/109.58/10
(12 reviews)

feedback
2 day(s)
delivery time

 
 
Hi, I'll be glad to help you.
Bid Time: 09-03-2010 03:44
 
send private message
Shortlist
Decline Bid
verminoz  
Salonica, GR
location
US$30
bid amount

10.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/10
(1 reviews)

feedback
1 day(s)
delivery time

 
 
Hello, I can help you with this. Open a chat session if you want us to discuss details.
Bid Time: 09-03-2010 04:15
 
send private message
Shortlist
Decline Bid
entropy3000  
fuzhou, CN
location
US$30
bid amount

(No Feedback Yet)
feedback
1 day(s)
delivery time

 
 
As a computer teacher is glad to help you
Bid Time: 09-03-2010 05:44
 
 


 
Get the Free Step-by-Step Guide on How to Use GetACoder
The act of outsourcing jobs has become easy in the past few years thanks to GetACoder. However, our team aims at making the whole process even easier. So, it has now come the time to provide you with a step-by-step guidance on how to use this service and succeed in the outsourcing world totally for FREE.

It doesn't matter if you are a more experienced user or a novice; using GetACoder will become even simpler with the help of this E-book. There are two major sections: a Buyers section and a Coders section.

Buyers will learn:
  • How to outsource safely
  • How to pick the best freelancers
  • How to manage time and money

Coders will learn:

  • How to get the best jobs
  • How to secure their payments
  • How to build a long-lasting relationship with buyers

    ...and MUCH MORE
Clear examples and pictures illustrating key situations, great tips and real testimonies of some of our best users... all in this Outsourcing Guide.  So don't loose the outstanding opportunity to download GetACoder FREE E-book.
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
What is GetACoder?

GetACoder.comGetACoder is a leading Global Services Marketplace doing business in more than 200 countries. Our unique system accelerates your time to market and provides your business with key competitive advantages. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage. GetACoder makes outsourcing to any part of the world an easy task! With GetACoder it's simple to outsource any business request, gain access to global talent and manage jobs online.

One of the main advantages of GetACoder is the low labor cost. The typically rates are about seven times lower than the ones in the US or Europe. Posting a request at GetACoder allows the right professional or company to find you and to bid for your work. We are building a reputation for exceeding our customers' expectations and for becoming an extremely cost effective way to outsource work. Use GetACoder when you want to save money, increase efficiency or accelerate the development of your request. With GetACoder you focus on growing your business and let others do the tedious work. Post your request on GetACoder for free. Find out why people outsource jobs with us day after day.

Thousands of Satisfied Customers - Submit/View Quotes


-Simply Super! - shankii
-This is one awesome site! I submitted a request and within a few hours I had replies from coders around the world. Yo! - woody
-Thanks for providing such an excellent interface for buyers and sellers to do business. - bestbuykaran
Report Violation    Privacy Policy     Affiliate Program    Terms of Use    Contact Us    Help      GetACoder.com on Facebook      Follow GetACoder on Twitter      GetACoder.com Latest Requests RSS Feed
© 2004-2012 GetACoder. All rights reserved.