Find Jobs
Hire Freelancers

2 dimensional array

$10-30 USD

Tamamlandı
İlan edilme: 9 yıldan fazla önce

$10-30 USD

Teslimde ödenir
Write a C++ program, [login to view URL], that randomly finds a path from the center of a two dimensional array. The program first initializes a two dimensional char array to all periods. The program starts at the middle of the array. It places an ‘a’ at this spot in the array. It then repeatedly picks a random direction (up, down, left or right) that travels to a spot not yet visited and places the next letter of the alphabet there. The program stops when the pathway reaches an edge of the array or there is no legal spot to move. You are required to write the following functions to help solve the problem: // set all spots in the board equal to period // characters void init_board (char board [max_row][max_col]); // sets row and col equal to a new row and column using // a random move (up, down, left or right) to a spot in // the array not yet visited void move (char box[max_row][max_col], int& row, int& col); // function returns true if there is no legal move (up, // down, right, or left) from current row and column. bool fail (char box[max_row][max_col], int row, int col); // function returns true if the edge of the box has been // reached bool success (int row, int col); // prints the array in two dimensional format with // a single linefeed between rows and no spaces. void print (char box [max_row][max_col]); // returns the next character to be printed in the path // given the current character. Letters change from // lowercase to uppercase to lowercase… char next (char current); max_row and max_col are constants giving the size of the array. The program should work for different values of max_row and max_col. When the lowercase alphabet is exhausted, the markers should change to the uppercase alphabet. When the uppercase alphabet is exhausted, the markers should change back to lowercase alphabet, and so on. If an edge of the array is reached, the word “Success” should be printed along with the array. When there is no legal move from a spot, the word “Failure” should be printed along with the array. Two runs of the program with max_row = 20 and max_col = 50 are shown on the next page of this handout. The program should run differently each run. When done, place the [login to view URL] file in the Homework 2 assignment area on Blackboard. Run 1 (max_row = 20, max_col = 30): Success! The path is: .............................. .............................. .............................. .............................. .............................. .............................. .............................. .............................. .........................vwzA. ...............a.........uxyBC .............feb.....VWXst.... .............gdcPQRSTU.Yr..... ............ih..ON.....Zqp.... ............juv..M.....ano.... ..........mlktw.KLGF...bml.... ..........norsxyJIHE...c.kji.. ...........pq..zABCD...defgh.. .............................. .............................. .............................. Run 2 (max_row = 15, max_col = 30): Failure! The path is: .............................. .............................. .............................. .............................. .............................. ............gf................ ............hedc.............. .........nmli..b.............. .........oxkj..a.............. .........pwv.................. .........q.u.................. .........rst.................. .............................. .............................. ..............................
Proje No: 6494227

Proje hakkında

6 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 10 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
Seçilen:
Kullanıcı Avatarı
Hi there, I've already read and understood the project requirement, and I can complete this one for you. So really hope to have chance to work with you, thanks for your consideration! Regards.
$30 USD 0 gün içinde
5,0 (24 değerlendirme)
4,2
4,2
6 freelancer bu proje için ortalama $46 USD teklif veriyor
Kullanıcı Avatarı
hello.............message me ...........i would like to work on this...........i have very good experience in programming..............i can get your work done very quickly..........waiting for your response..thanks & regards
$25 USD 1 gün içinde
4,6 (24 değerlendirme)
3,6
3,6
Kullanıcı Avatarı
I could help you. . . .
$40 USD 1 gün içinde
4,9 (5 değerlendirme)
2,8
2,8
Kullanıcı Avatarı
can do iit...........................................................................................
$111 USD 1 gün içinde
5,0 (1 değerlendirme)
1,9
1,9
Kullanıcı Avatarı
Everything you need will be implemented in the program. Centered 'A' going in random direction every time. Pick me and you will not be disappointed. Thank you :) Have a nice day.
$35 USD 3 gün içinde
0,0 (0 değerlendirme)
0,0
0,0
Kullanıcı Avatarı
I can start right away. Can get it done in 4-6 hours tops. Have a lot of experience in c/c++ developing. Been studying it for 6 ears now. Waiting for you response.
$25 USD 0 gün içinde
0,0 (0 değerlendirme)
0,0
0,0

Müşteri hakkında

   UNITED STATES bayrağı
new york, United States
5,0
3
Eyl 23, 2014 tarihinden bu yana üye

Müşteri Doğrulaması

Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.