Ask Question
9 September, 04:44

Two variables, num_boys and num_girls, hold the number of boys and girls that have registered for an elementary school. The variable budget holds the number of dollars that have been allocated to the school for the school year. Write code that prints out the per-student budget (dollar spent per student). If a division by zero error takes place, just print out the word "unavailable".

+3
Answers (1)
  1. 9 September, 06:21
    0
    Using python

    num_boys = int (input ("Enter number of boys : "))

    num_girls = int (input ("Enter number of girls : "))

    budget = int (input ("Enter the number of dollars spent per school year : "))

    try:

    dollarperstudent = budget / (num_boys+num_girls)

    print ("Dollar spent per student : "+str (dollarperstudent)) #final result

    except ZeroDivisio nerror:

    print ("unavailable")
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Two variables, num_boys and num_girls, hold the number of boys and girls that have registered for an elementary school. The variable budget ...” in 📘 Engineering if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers