Please check for error.. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Please check for error..

There is no compilation error. But code is not giving the desired result. This code is composed by me on my pc, not on this sololearn platform. In this code, I'm trying to automatically generate timetable for various classes of a school. Concept of this code is that, no teacher should have the same period and each period should be assigned to each teacher. Total no. of periods each day=8 Total no. of working days=6 Output to be obtained : user should be asked for the class's timetable he wants to see, and by the time time table should be generated automatically and stored in a file. Please help me with this code. https://code.sololearn.com/c7Ud9xL0nlYU/?ref=app https://code.sololearn.com/c7Ud9xL0nlYU/?ref=app

7th Oct 2018, 7:04 AM
Vaibhav
Vaibhav - avatar
3 Respostas
+ 2
Change for (int i = 1; i <= 6; i++) to: for (int i = 0; i < 6; i++) You're accessing out of bound values. The inner loop has the same error. That's the first thing that caught my eyes, there might be more bugs.
7th Oct 2018, 8:55 AM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
0
Any answer please... šŸ˜¦šŸ˜¦ Or suggest me something else. šŸ˜•šŸ˜•
7th Oct 2018, 7:24 AM
Vaibhav
Vaibhav - avatar
0
Ok, I got your point. I'd been trying to make this program(ie. to automatically generate timetable for a school) for a week, but not getting the proper logic for it. Some error remains over there, which made me exhausted now. Please suggest some easier way(logic) for the program.
7th Oct 2018, 11:42 PM
Vaibhav
Vaibhav - avatar