Find Jobs
Hire Freelancers

C Homework Project Not C++,

$15-20 USD

Opravljeno
Objavljeno pred skoraj 22 leti

$15-20 USD

Plačilo ob dostavi
1. I need all 2 problems solved in the next 24 hours. 2. I need the program to be written in C and NOT C++. 3. It has to be well commented. 4. I need it by 9:00am United States CT. 5. It needs to be compiled in Microsoft Visaul C++ 6.0. 6. The code file should be .c ## Deliverables Problem 3_1 Due May 29, 2002 Slot Machine Write a program that simulates a slot machine. A slot machine consists of three slots, which each contain a rotating wheel. On the wheels are symbols of fruits: cherry, banana, pear orange. A handle is activated to make the wheels spin. When the wheels stop, the player wins if all three slots show the same fruit. Declare three arrays in all, each one represents a single slot. · Wheel one contains the following list of fruits: cherry, cherry, banana, pear, pear, pear, pear, orange. · Wheel two contains the following list of fruits: cherry, banana, banana, banana, pear, orange, orange. · Wheel three contains the following list of fruits: cherry, banana, pear, pear, orange, orange. Each array will contain a code for the fruits: the first letter of the name of the fruit. The fruit will be randomly selected by having rand( ) generate an index into each array. Write the program to allow a user to play as many games as he wishes. When he finishes give a total of the games he played, and the total he won. Write at least two functions other than main. Decide for yourself what those functions should be. Problem 3_2 The Birthday Problem Given a random group of N people, how likely is it that two people have the same birthday? To answer this question, write a program that creates an array of N integers, randomly assigns to each position in the array one of the integers from 1 through 365, and checks to see if any of the subscripted variables have the same value. (Make the simplifying assumption that no birthday occurs on February 29th.) Now expand the program to repeat the process 1000 times at that value of N, and determine the percentage of the time that there is a single match. Running the simulation, you want to count the number of times out of the 1000 times where a match was found. Do not find the total number of matches in any group of people, because you are only answering the question of how likely it is to find at least two people with the same birthday. If a match is found in any trial, the search can be halted, and the next trial executed. Try to answer the question how many people are needed in the group to achieve a 50% probability that at least two people will have the same birthday. So allow the user to determine the value of N, and allow multiple runs of the program for different values of N. Include in a comment the value of N you found to be the correct one. The numbers from 1 to 365 should be generated by calling the functions srand(time(NULL) ) once at the beginning of the program and rand( ) for each number from 1 to 365. The main activity of the program will be searching the array for a match. There is a theoretical answer for the 50% number that you might find in a probability book. You can't declare an array in C with a variable. There is a way to dynamically allocate an array at run time, and we will learn it later. So you must declare an array large enough to handle any N input by the user. Just use the portion of the larger array needed. Remember you are trying to find the N that gives an answer close to 50 % of the time. Again use at least two functions other than main. Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. ## Platform 1. I need all 2 problems solved in the next 24 hours. 2. I need the program to be written in C and NOT C++. 3. It has to be well commented. 4. I need it by 9:00am United States CT. 5. It needs to be compiled in Microsoft Visaul C++ 6.0. 6. The code file should be .c ## Deadline information I need the program in 24 hours.
ID projekta: 2853162

Več o projektu

9 ponudb
Projekt na daljavo
Aktivno pred 22 leti

Želite zaslužiti?

Prednosti oddajanja ponudb na Freelancerju

Nastavite svoj proračun in časovni okvir
Prejmite plačilo za svoje delo
Povzetek predloga
Registracija in oddajanje ponudb sta brezplačna
Dodeljeno:
Avatar uporabnika
See private message.
$17 USD v 14 dneh
5,0 (35 ocen)
5,0
5,0
9 freelancerjev je oddalo ponudbo s povprečno vrednostjo $16 USD za to delo
Avatar uporabnika
See private message.
$17 USD v 14 dneh
4,9 (149 ocen)
5,6
5,6
Avatar uporabnika
See private message.
$17 USD v 14 dneh
4,4 (72 ocen)
5,5
5,5
Avatar uporabnika
See private message.
$17 USD v 14 dneh
5,0 (38 ocen)
4,8
4,8
Avatar uporabnika
See private message.
$17 USD v 14 dneh
5,0 (2 ocen)
2,7
2,7
Avatar uporabnika
See private message.
$17 USD v 14 dneh
5,0 (1 ocena)
1,1
1,1
Avatar uporabnika
See private message.
$17 USD v 14 dneh
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
See private message.
$11,05 USD v 14 dneh
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
See private message.
$12,75 USD v 14 dneh
0,0 (0 ocen)
0,0
0,0

O stranki

Zastava PAKISTAN
Pakistan
0,7
2
Član(ica) od mar. 27, 2002

Verifikacija stranke

Hvala! Po e-pošti smo vam poslali povezavo za prevzem brezplačnega dobropisa.
Pri pošiljanju vašega e-sporočila je šlo nekaj narobe. Poskusite znova.
Registrirani uporabniki Skupaj objavljenih del
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Nalaganje predogleda
Geolociranje je bilo dovoljeno.
Vaša prijavna seja je potekla, zato ste bili odjavljeni. Prosimo, da se znova prijavite.