Find Jobs
Hire Freelancers

Complete Program for Even/Odd Numbers

$10-30 USD

Selesai
Dibuat lebih dari 10 tahun yang lalu

$10-30 USD

Dibayar ketika dikirim
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 Proyek: 5068689

Tentang proyek

3 proposal
Proyek remot
Aktif 11 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
Diberikan kepada:
Avatar Pengguna
Hi, client. I am interested in this job. Please give me this job. I think this is very easy for me. Regards.
$14 USD dalam 0 hari
2,9 (11 ulasan)
4,7
4,7
3 freelancer menawar dengan rata-rata $18 USD untuk pekerjaan ini
Avatar Pengguna
Hi We are experts in c++ ,we can do the programming for you .You can palce order with us .... Thanks
$30 USD dalam 2 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
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 dalam 0 hari
0,0 (0 ulasan)
0,0
0,0

Tentang klien

Bendera UNITED STATES
Sunnyvale, United States
5,0
22
Anggota sejak Okt 16, 2013

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.