Find Jobs
Hire Freelancers

Complete Program for Even/Odd Numbers

$10-30 USD

Imekamilika
Imechapishwa over 10 years ago

$10-30 USD

Kulipwa wakati wa kufikishwa
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
Kitambulisho cha mradi: 5068689

Kuhusu mradi

3 mapendekezo
Mradi wa mbali
Inatumika 11 yrs ago

Unatafuta kupata pesa?

Faida za kutoa zabuni kwenye Freelancer

Weka bajeti yako na muda uliopangwa
Pata malipo kwa kazi yako
Eleza pendekezo lako
Ni bure kujiandikisha na kutoa zabuni kwa kazi
Imetolewa kwa:
Picha ya Mtumiaji
Hi, client. I am interested in this job. Please give me this job. I think this is very easy for me. Regards.
$14 USD ndani ya siku 0
2.9 (11 hakiki)
4.7
4.7
3 wafanyakazi huru wana zabuni kwa wastani $18 USD kwa kazi hii
Picha ya Mtumiaji
Hi We are experts in c++ ,we can do the programming for you .You can palce order with us .... Thanks
$30 USD ndani ya siku 2
0.0 (0 hakiki)
0.0
0.0
Picha ya Mtumiaji
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 ndani ya siku 0
0.0 (0 hakiki)
0.0
0.0

Kuhusu mteja

Bedera ya UNITED STATES
Sunnyvale, United States
5.0
22
Mwanachama tangu Okt 16, 2013

Uthibitishaji wa Mteja

Asante! Tumekutumia kiungo cha kudai mkopo wako bila malipo kwa barua pepe.
Hitilafu fulani imetokea wakati wa kutuma barua pepe yako. Tafadhali jaribu tena.
Watumiaji Waliosajiliwa Jumla ya Kazi Zilizochapishwa
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Onyesho la kukagua linapakia
Ruhusa imetolewa kwa Uwekaji wa Kijiografia.
Muda wako wa kuingia umeisha na umetoka nje. Tafadhali ingia tena.