Find Jobs
Hire Freelancers

Complete Program for Even/Odd Numbers

$10-30 USD

Opravljeno
Objavljeno pred več kot 10 leti

$10-30 USD

Plačilo ob dostavi
Complete this program using the following declarations, the TypeString array, and the main(). enum Type{Even, Odd}; union Value { int i; double d; }; struct Number { Type type; Value value; }; const string TypeString[2] = {"even","odd"}; int main() { Number var[10]; for (int i= 0; i < 10; i++) assign(var[i]); for (int i= 0; i < 10; i++) print(var[i]); } You will need to add assign() and print() functions. The assign() function generates a random int between 1 and 100. If the int is even, it is stored in the Value union and Even in the Type. If the in is odd, then the square root of the random number is stored in the Value union and Odd in the Type. The output from the print function should look like the following. Make use of the TypeString array in your print() function. Number is even 42 Number is even 68 Number is odd 5.91608 Number is odd 1 Number is even 70 Number is odd 5 Number is odd 8.88819 Number is odd 7.68115 Number is odd 7.93725 Number is odd 8.06226
ID projekta: 5068689

Več o projektu

3 ponudb
Projekt na daljavo
Aktivno pred 11 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
Hi, client. I am interested in this job. Please give me this job. I think this is very easy for me. Regards.
$14 USD v 0 dnevu
2,9 (11 ocen)
4,7
4,7
3 freelancerjev je oddalo ponudbo s povprečno vrednostjo $18 USD za to delo
Avatar uporabnika
Hi We are experts in c++ ,we can do the programming for you .You can palce order with us .... Thanks
$30 USD v 2 dneh
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
Brother! I want to do this. i will provide you best. Just gave a chance to your brother. I want to start it now. Regards
$10 USD v 0 dnevu
0,0 (0 ocen)
0,0
0,0

O stranki

Zastava UNITED STATES
Sunnyvale, United States
5,0
22
Član(ica) od okt. 16, 2013

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.