Ask Question
23 April, 13:59

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".

+1
Answers (1)
  1. 23 April, 14:09
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers