Find Jobs
Hire Freelancers

C++ Program

$10-30 USD

Ολοκληρώθηκε
Αναρτήθηκε περίπου 7 χρόνια πριν

$10-30 USD

Πληρωμή κατά την παράδοση
Create a program that will play the "Bulls and Cows" game with the user. The game works like this: Randomly generate a 4-digit number where all four digits are unique. Ask the user to guess a 4-digit number. For every digit that the digit the user guessed correctly in the correct place, they have a "bull" (as in bullseye). For every digit the user guessed correctly in the wrong place is a "cow". Every time the user makes a guess, tell them how many "bulls" and "cows" they have. Once the user guesses the correct number, the game is over. Keep track of the number of guesses the user makes throughout the game and the time it takes to correctly guess the 4-digit number. At the end of the game tell the user how many guesses and how long it took to win. This assignment is one to give you practice with vector. You will also find yourself implementing a linear search and having a need for a nested for-loop. Populate your vector(s) with the push_back method. DO NOT use any string methods or a character array to isolate the individual digits within a user's guess or any functionality from <algorithm>. Instead use integer division and remainders to isolate the individual digits. And DO NOT use any functions from <algorithm>. BUT do feel free to use any vector member functions. All text produced by your program should have a format identical to what is shown below. Here is a sample run, where the program picked 9736: Enter a 4 digit number(unique digits): 0987 bulls = 0 and cows = 2 Enter a 4 digit number(unique digits): 9078 bulls = 1 and cows = 1 Enter a 4 digit number(unique digits): 9780 bulls = 2 and cows = 0 Enter a 4 digit number(unique digits): 9580 bulls = 1 and cows = 0 Enter a 4 digit number(unique digits): 9740 bulls = 2 and cows = 0 Enter a 4 digit number(unique digits): 9721 bulls = 2 and cows = 0 Enter a 4 digit number(unique digits): 9768 bulls = 2 and cows = 1 Enter a 4 digit number(unique digits): 9785 bulls = 2 and cows = 0 Enter a 4 digit number(unique digits): 9756 bulls = 3 and cows = 0 Enter a 4 digit number(unique digits): 9706 bulls = 3 and cows = 0 Enter a 4 digit number(unique digits): 9716 bulls = 3 and cows = 0 Enter a 4 digit number(unique digits): 9726 bulls = 3 and cows = 0 Enter a 4 digit number(unique digits): 9736 bulls = 4 and cows = 0 You guessed it in 13 tries, taking 2 minutes and 49 seconds
Ταυτότητα εργασίας: 13382105

Σχετικά με την εργασία

7 προτάσεις
Απομακρυσμένη Εργασία
Ενεργός/ή 7 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
Βραβεύτηκε στον/στην:
Avatar Χρήστη
LET ME DO IT! :D I will provide you the quickest turnaround. Within an hour!! I won't waste your time. This is a simple task!
$20 USD σε 1 ημέρα
5,0 (2 αξιολογήσεις)
1,5
1,5
7 freelancers δίνουν μια μέση προσφορά $29 USD για αυτή τη δουλειά
Avatar Χρήστη
Hello I am C++ expert and interested in this project. I have reviewed the details of Bulls and Cows Game and confident to handle it perfectly. I have a lot of experience in helping in students with assignments, so I will keep codes well documented and simple. Please communicate to discuss further. Regards Anshu
$30 USD σε 1 ημέρα
4,8 (167 αξιολογήσεις)
6,3
6,3
Avatar Χρήστη
Hello. How are you. I have read and understood the project. I have strong knowledge in Data structures and Algorithms. And I'm expert in Java ,C/C++,C#, Python ,PHP etc. I'm interested this project. So, firstly I want to discuss with you about this project. Then I'll be happy. I wait for your good reply. Thanks.
$35 USD σε 1 ημέρα
5,0 (46 αξιολογήσεις)
5,2
5,2
Avatar Χρήστη
To get clients satisfaction with reliability of less error output. Proven ability to collect and manage information efficiently and accurately.
$20 USD σε 1 ημέρα
0,0 (0 αξιολογήσεις)
0,0
0,0

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
New York, United States
5,0
6
Επαληθευμένη μέθοδος πληρωμής
Μέλος από Φεβ 27, 2017

Επαλήθευση Πελάτη

Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.