Python Forum
Simple exercise - how to write in python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Simple exercise - how to write in python (/thread-5107.html)



Simple exercise - how to write in python - tomtom55 - Sep-19-2017

... just I'm really bad in math. Can anybody help me out?

Write a program to solve the following problem. At the beginning of the school year, the program manager has to split the students between the practical sessions. The manager wishes to divide the students between the classes as equally as possible. Write a program that asks the manager for the number of class rooms and for the number of students. The program should then output the number of students in each class room.

Test your program with the following inputs: number of students: 100, number of rooms: 20 number of students: 105, number of rooms: 10 number of students: 1050, number of rooms: 45

Some examples of the program output are shown below: Enter number of students: 103 Enter number of rooms: 15 In 13 classes there are 7 students In 2 classes there are 6 students


RE: Simple exercise - how to write in python - stranac - Sep-19-2017

(Sep-19-2017, 10:09 AM)tomtom55 Wrote: just I'm really bad in math.
For your example - 103 students in 15 classes :
15 goes into 103 6 times, with a remainder of 13 <- all the math you need


RE: Simple exercise - how to write in python - tomtom55 - Sep-19-2017

Cool. I need python code for this


RE: Simple exercise - how to write in python - buran - Sep-19-2017

(Sep-19-2017, 10:22 AM)tomtom55 Wrote: Cool. I need python code for this
Great, start coding :-) Because we are not going to do your homework for you. When you have some code, post it in code tags and ask specific questions. We will be glad to assist you in resolving specific issues.


RE: Simple exercise - how to write in python - tomtom55 - Sep-19-2017

If you really must know, I cannot code, haven't done any math for decades.
My question is specific. What exactly here is confusing to you, I'll try and clarify it?


RE: Simple exercise - how to write in python - stranac - Sep-19-2017

There's nothing confusing here.
You want us to write code for you, and you're not showing any effort of your own.
We're here to help people learn, not do what looks like their homework for them.

If you're looking to hire someone to write code for you, post in the Jobs section, and maybe someone will come along to help in exchange for money, goods, or services.


RE: Simple exercise - how to write in python - nilamo - Sep-28-2017

(Sep-19-2017, 11:06 AM)tomtom55 Wrote: If you really must know, I cannot code, haven't done any math for decades.

Me neither, but I write code all the time. Programming is mostly unrelated to math except in certain domains.