Filtre

Son aramalarım
Şuna göre filtrele:
Bütçe
ile
ile
ile
Tür
Beceri
Diller
    İş Durumu
    24 cstdlib iş bulundu, ücretlendirmeleri EUR

    #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(NULL)); // initialize random seed int position = 0; // initialize car position to 0 // loop until car reaches finish line while (position < 10) { int move = rand() % 3 + 1; // generate random number between 1 and 3 position += move; // move car cout << "Car moved " << move << " spaces. Position: " << position << endl; } cout << "Car wins!" << endl; return 0; } for python import random position = 0 # initialize car position to 0 # loop until car reaches finish line while position < 10: move = (1, 3) # generate random numb...

    €15 / hr (Avg Bid)
    €15 / hr Ortalama Teklif
    10 teklifler

    #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(NULL)); // initialize random seed int position = 0; // initialize car position to 0 // loop until car reaches finish line while (position < 10) { int move = rand() % 3 + 1; // generate random number between 1 and 3 position += move; // move car cout << "Car moved " << move << " spaces. Position: " << position << endl; } cout << "Car wins!" << endl; return 0; } for python import random position = 0 # initialize car position to 0 # loop until car reaches finish line while position < 10: move = (1, 3) # generate random numb...

    €10 / hr (Avg Bid)
    €10 / hr Ortalama Teklif
    11 teklifler
    Ludo Games Bitti left

    Only use #include <iostream> #include <string> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip>

    €145 (Avg Bid)
    €145 Ortalama Teklif
    13 teklifler
    Dice conrep Bitti left

    ...rolls. The number of trials is specified by the user. Suppose the user specifies 2 trials, and this sequence of tosses occurs: Trial 1: 7 10 5 7 (4 tosses) Trial 2: 7 4 9 8 6 4 11 10 7 (9 tosses) So for the target sum 7, the number of trials is 2, and the average number of tosses is (4+9)/2 = 6.5 The only libraries that may be included for this project are <iostream>, <cstdlib>, and <ctime>. Seed the random number generator so that different results are obtained on each run. Do NOT use any arrays. Here are three sample runs: <> ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run

    PHP
    €7 - €17
    €7 - €17
    0 teklifler
    Simulation Bitti left

    Background: In the land of Puzzlevania, Aaron, Bob, and Charlie had an argument over which one of them was the greatest puzzle-solver of all ti...to create multiple functions to complete the problem. Once you can simulate a duel, add a loop to your program that simulates 10,000 duels. Count the number of times that each contestant wins and print the probability of winning for each contestant (e.g., for Aaron your might output "Aaron won 3595/10000 duels or 35.95%). Hint: You can start out with: #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(time(0)); //Since we will be using rand() } Review how does random number generator works Use boolean variable for each to keep track if they ...

    €17 (Avg Bid)
    €17 Ortalama Teklif
    3 teklifler

    ...the allotted hands have been played, announce the outcome: cout &lt;&lt; &quot;Player has &quot; &lt;&lt; bankroll &lt;&lt; &quot; after &quot; &lt;&lt; thishand-1 &lt;&lt; &quot; handsn&quot;; III.d Implementation Rules * You may #include &lt;iostream&gt;, &lt;iomanip&gt;, &lt;string&gt;, &lt;cstdlib&gt;, and &lt;cassert&gt;. No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file). You may also include &lt;cmath&gt;, but only for use in your Competitor. Other include files for yo...

    SQL
    €82 (Avg Bid)
    €82 Ortalama Teklif
    4 teklifler

    ...the allotted hands have been played, announce the outcome: cout &lt;&lt; &quot;Player has &quot; &lt;&lt; bankroll &lt;&lt; &quot; after &quot; &lt;&lt; thishand-1 &lt;&lt; &quot; handsn&quot;; III.d Implementation Rules * You may #include &lt;iostream&gt;, &lt;iomanip&gt;, &lt;string&gt;, &lt;cstdlib&gt;, and &lt;cassert&gt;. No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file). You may also include &lt;cmath&gt;, but only for use in your Competitor. Other include files for yo...

    SQL
    €46 - €46
    €46 - €46
    0 teklifler

    ...the player either has too little money to make a minimum wager *or* the allotted hands have been played, announce the outcome: cout << &quot;Player has &quot; << bankroll << &quot; after &quot; << thishand-1 << &quot; handsn&quot;; III.d Implementation Rules * You may #include <iostream>, <iomanip>, <string>, <cstdlib>, and <cassert>. No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file). You may also include <cmath>, but only for use in your Competitor. Other include files for your Competitor m...

    €37 - €37
    €37 - €37
    0 teklifler

    Hello I'm developing my tools in Visual C++ When i'm using standard C library functions the MSVCRT will be a dependency on my program, which is not desirable I'm looking for implementions of some C functions (see ...*haystack, const char *needle) { unsigned int needle_len = lstrlen(needle); for (;*haystack;++haystack){ if (strncmp(haystack,needle,needle_len) == 0){ return haystack; } } return NULL; } I'm looking for FAST, FAIL-PROOF, LIGHTWEIGHT (NO 150 lines of code implementions of functions) implementions of the following functions: strtol - () sprintf (or _snprintf) - () sscanf - ()

    €34 (Avg Bid)
    €34 Ortalama Teklif
    4 teklifler

    ...it unchanged as appropriate. cout << "Dealer winsn"; cout << "Player winsn"; cout << "Pushn"; • Finally, when the player either has too little money to make a minimum wager or the allotted hands have been played, announce the outcome: cout << "Player has " << bankroll << " after " << thishand-1 << " handsn"; Implementation Rules • You may #include <iostream>, <iomanip>, <string>, <cstdlib>, and <cassert>. No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file). You ma...

    €186 (Avg Bid)
    €186 Ortalama Teklif
    1 teklifler

    ...existing file. The word quit must appear by itself on the line. For an illegal command, merely print an informative error message to cerr. For one of the commands update or list, merely echo the command and its arguments. (You don't need to maintain any actual inventory—you do that in exercise 2.) For the quit command, terminate the program using the one-argument exit function declared in &lt;cstdlib&gt;. For the batch command, do the following: read, recognize, and process commands from the specified file, then (assuming that a quit command has not been read) resume reading commands from cin. Assume that the file does not contain any batch commands. Miscellaneous information You should fill in the blanks in the InterpretCommands function given in ~cs9f/...

    €19 (Avg Bid)
    €19 Ortalama Teklif
    1 teklifler
    blackjack Bitti left

    ...Finally, when the player either has too little money to make a minimum wager *or* the allotted hands have been played, announce the outcome: cout << "Player has " << bankroll << " after " << thishand-1 << " handsn"; III.d Implementation Rules * You may #include <iostream>, <iomanip>, <string>, <cstdlib>, and <cassert>. No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file). You may also include <cmath>, but only for use in your Competitor. Other include files for your Competit...

    €46 (Avg Bid)
    €46 Ortalama Teklif
    1 teklifler
    C++ Sorting 1 Bitti left

    ... ## Deliverables ------------------------------------------------------------------------ Mergesort 0.000 0.000 Heapsort 0.000 0.000 Quicksort 0.000 0.000 OR Sort Unsorted time // Choice b from the menu --------------------------------------- Mergesort 0.000 Heapsort 0.000 Quicksort 0.000 -1- CSC 3412 Homework 5 Summer 2004 Notes 1. 2. 1. You may use the rand() function from <cstdlib> to generate your pseudorandom numbers. 3. 2. You may use the clock() function from <ctime> to help you generate clock times. 4. 3. You should use operators new and delete to allocate and deallocate your arrays. 5. 4. Each sort should sort the same numbers in the same order. 6. 5. Be sure to test your program using the g++ compiler before s...

    €23 (Avg Bid)
    €23 Ortalama Teklif
    19 teklifler
    C++ Sorting Bitti left

    ...// Choice d from the menu ## Deliverables ------------------------------------------------------------------------ Mergesort 0.000 0.000 Heapsort 0.000 0.000 Quicksort 0.000 0.000 OR Sort Unsorted time // Choice b from the menu --------------------------------------- Mergesort 0.000 Heapsort 0.000 Quicksort 0.000 Notes 1. 2. 1. You may use the rand() function from <cstdlib> to generate your pseudorandom numbers. 3. 2. You may use the clock() function from <ctime> to help you generate clock times. 4. 3. You should use operators new and delete to allocate and deallocate your arrays. 5. 4. Each sort should sort the same numbers in the same order. 6. 5. Be sure to test your program using the g++ compiler before...

    €31 (Avg Bid)
    €31 Ortalama Teklif
    28 teklifler
    Dice Bitti left

    ...two dice rolls. The number of trials is specified by the user. Suppose the user specifies 2 trials, and this sequence of tosses occurs: Trial 1: 7 10 5 7 (4 tosses) Trial 2: 7 4 9 8 6 4 11 10 7 (9 tosses) So for the target sum 7, the number of trials is 2, and the average number of tosses is (4+9)/2 = 6.5 The only libraries that may be included for this project are <iostream>, <cstdlib>, and <ctime>. Seed the random number generator so that different results are obtained on each run. Do NOT use any arrays. Here are three sample runs: <> ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition

    €11 (Avg Bid)
    €11 Ortalama Teklif
    25 teklifler
    Guessing Game Bitti left

    This assignment requires the use of random numbers. You must include the <cstdlib> and <ctime> header files to allow access to rand() and srand(), respectively. These will be discussed in class. The program will implement a “guessing game.?? Ask the user for a number in the range of 1 through 100, inclusive. If the guess is larger than the random number you generated in the range of 1 through 100, inform the user that the guess was too high. If the guess is too low, say so, and when the guess matches the random number, say so! Also, tell the user how many guesses were required. What should you do if the user inputs an invalid guess? Suppose the user enters 0 or 200? You should allow only valid guesses. Therefore, keep asking for guesses until the user enters a numb...

    €11 (Avg Bid)
    €11 Ortalama Teklif
    35 teklifler

    ...your program compiles and runs To compile: g++ -O3 -o EvSysEx3 Then to run: ./EvSysEx3 G. The optimal route has length 423.741. It is quite possible to evolve this. At worst you should be able to find routes of length < 500. Test that your program produces the correct output H. Submit your source code using the submit command (details on the course web page). #include <cstdlib> #include <ctime> #include <iostream> #include <cmath> using namespace std; ## Deliverables const int numTowns = 30; const int numGenotypes = 1000; const int genotypeLength = numTowns; const int numReproductions = 1000000; const int numMutationsPerReproduction = 1; const int towns[numTowns][2]= { {82, 7} , {91,38} , {62,32} , {71,44} , {83,...

    €16 (Avg Bid)
    €16 Ortalama Teklif
    1 teklifler

    ...remaining towns in the order they appear in parent 2. F. Test that your program compiles and runs To compile: g++ -O3 -o EvSysEx3 Then to run: ./EvSysEx3 G. The optimal route has length 423.741. It is quite possible to evolve this. At worst you should be able to find routes of length < 500. Test that your program produces the correct output ## Deliverables */ #include <cstdlib> #include <ctime> #include <iostream> #include <cmath> using namespace std; const int numTowns = 30; const int numGenotypes = 1000; const int genotypeLength = numTowns; const int numReproductions = 1000000; const int numMutationsPerReproduction = 1; const int towns[numTowns][2]= { {82, 7} , {91,38} , {62,32} , {71,44} , {83,69} , {68,58} , {54,67} , {87...

    €94 (Avg Bid)
    €94 Ortalama Teklif
    7 teklifler

    ...out. Write a program that repeatedly reads integers entered by a user. It should print in a bordered area, the integer read, the absolute value of the integer, the sum of the odd numbers from 1 to the absolute value of the integer and the sum of the even numbers from 0 to the absolute value of the integer. The program should stop when the user enters 0 as the integer. Use the abs in the cstdlib You will need: Boarder prints a boarder line across the screen and returns no value. Boarder takes either no parameters or, if you would like, parameters which describe the type and size of border drawn. Prompt_read prompts the user for an integer value and returns the integer value entered by the user. It takes no parameters Sum_odd takes a single positive integer parameter and...

    €15 (Avg Bid)
    €15 Ortalama Teklif
    19 teklifler
    class chain Bitti left

    ...integers, e.g. [2 7 -1 43] is a chain containing four integers. Please note that chains are similar in many respects to vectors of integers. The purpose of this assignment is to have you create a vector-like class from scratch, however, so you may not use vector, list or other classes from the STL here. In fact, unless you get permission from me, don't include any libraries except iostream and cstdlib. Pay special attention to Weiss's "big three," the destructor, copy constructor and assignment operator. When your class is complete, the following code should work, with results as commented: chain a, b, c; // Three empty chains are created cout << () << endl; // yields 0 cin >> a; // User types [2 3 7] cout << a; // Output ...

    €8 (Avg Bid)
    €8 Ortalama Teklif
    22 teklifler

    ...integers, e.g. [2 7 -1 43] is a chain containing four integers. Please note that chains are similar in many respects to vectors of integers. The purpose of this assignment is to have you create a vector-like class from scratch, however, so you may not use vector, list or other classes from the STL here. In fact, unless you get permission from me, don't include any libraries except iostream and cstdlib. Pay special attention to Weiss's "big three," the destructor, copy constructor and assignment operator. When your class is complete, the following code should work, with results as commented: chain a, b, c; // Three empty chains are created cout << () << endl; // yields 0 cin >> a; // User types [2 3 7] cout << a; // Output ...

    €28 - €56
    €28 - €56
    0 teklifler

    ...integers, e.g. [2 7 -1 43] is a chain containing four integers. Please note that chains are similar in many respects to vectors of integers. The purpose of this assignment is to have you create a vector-like class from scratch, however, so you may not use vector, list or other classes from the STL here. In fact, unless you get permission from me, don't include any libraries except iostream and cstdlib. Pay special attention to Weiss's "big three," the destructor, copy constructor and assignment operator. When your class is complete, the following code should work, with results as commented: chain a, b, c; // Three empty chains are created cout << () << endl; // yields 0 cin >> a; // User types [2 3 7] cout << a; // Output ...

    €28 - €56
    €28 - €56
    0 teklifler

    ...integers, e.g. [2 7 -1 43] is a chain containing four integers. Please note that chains are similar in many respects to vectors of integers. The purpose of this assignment is to have you create a vector-like class from scratch, however, so you may not use vector, list or other classes from the STL here. In fact, unless you get permission from me, don't include any libraries except iostream and cstdlib. Pay special attention to Weiss's "big three," the destructor, copy constructor and assignment operator. When your class is complete, the following code should work, with results as commented: chain a, b, c; // Three empty chains are created cout << () << endl; // yields 0 cin >> a; // User types [2 3 7] cout << a; // Output ...

    €29 (Avg Bid)
    €29 Ortalama Teklif
    43 teklifler

    Implement co...set up a pointer to it and allocate it on the heap; otherwise just put int u[262144]; as global. The problem is that Win32 sets up a default stack of 1 megabyte. So a local declaration of int u[262144] in main() overflows the stack immediately and your program crashes. Another superiority of Linux :-) CPU Timing (for C and C++): You will need to include stdlib.h and time.h to use this. (That's cstdlib and ctime in newer C++ compilers) ... double start, elap; start = clock(); (task to be timed goes here) elap = (clock() - start) / CLOCKS_PER_SEC; Now, elap will be the elapsed time (in seconds) -- I would normally print this out to 2 decimal places. Note: PLEASE WRITE THIS PROGRAM IN C++ . I use the Visual C++ 6.0 to run it ## Deadline information please send t...

    €19 (Avg Bid)
    €19 Ortalama Teklif
    16 teklifler