question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
A bike costs $250. If John has saved $150, how much more does he need to save to buy the bike?
def solve() -> int: saved = 150 bike_cost = 250 more_needed = bike_cost - saved result = more_needed return result
A box contains 80 crayons. If 20 crayons are red, 15 crayons are blue, and the rest are green, how many green crayons are in the box?
def solve() -> int: total = 80 red = 20 blue = 15 green = total - red - blue result = green return result
Student: A car dealership sells cars that are brand new and used. They sold 10 brand new cars for $25,000 each, and 6 used cars for $15,000 each. Calculate how much money the dealership made from selling cars.
def solve() -> int: new_cars = 10 new_price = 25000 used_cars = 6 used_price = 15000 new_revenue = new_cars * new_price used_revenue = used_cars * used_price total_revenue = new_revenue + used_revenue result = total_revenue return result
Noah rented a kayak and accidentally capsized, losing his paddle in the process. He needs to pay for the cost of the paddle, which is priced at $25. In addition, he has to pay for the damaged kayak, which costs $150, and for the 4 hours of overtime pay for the rental staff who had to fix everything, which costs $8/hour...
def solve() -> int: paddle_cost = 25 kayak_cost = 150 overtime_hours = 4 overtime_pay = 8 hourly_pay = 10 total_cost = paddle_cost + kayak_cost + (overtime_hours * overtime_pay) hours_worked = total_cost / hourly_pay result = hours_worked return result
A car travels 120 miles in 2 hours. What is the average speed of the car in miles per hour?
def solve() -> int: distance = 120 time = 2 speed = distance / time result = speed return result
Martin pays to his 5 employees $2200 a month. His electricity bill is the twice of the salaries of 3 employees and the water bill is the same as the salaries of 2 employees. How much does Martin pay for electricity and water every month?
def solve() -> int: salary = 2200 e_bill = salary * 3 * 2 w_bill = salary * 2 result = e_bill + w_bill return result
The factory fills 40% of the number of boxes in the warehouse. If there are 80 boxes in the warehouse, how many boxes did the factory fill?
def solve() -> int: warehouse_boxes = 80 fill_percentage = 40 fill_boxes = (fill_percentage / 100) * warehouse_boxes result = fill_boxes return result
A person adjusts their running speed throughout a race. For the first 2 miles, they run at a pace of 9 minutes per mile. For the next 4 miles, they increase their pace to 8 minutes per mile. And for the final 3 miles, they slow down to a pace of 10 minutes per mile. If they had already run 3 miles at a pace of 10 minut...
def solve() -> int: first_distance = 2 second_distance = 4 third_distance = 3 first_pace = 9 second_pace = 8 third_pace = 10 already_run_distance = 3 first_time = first_distance * first_pace second_time = second_distance * second_pace third_time = third_distance * third_pace...
20 students went on a school trip. If each one of the students paid $80 for the trip, how much money was spent in total?
def solve() -> int: money_spent = 0 num_of_students = 20 for i in range(num_of_students): money_spent += 80 result = money_spent return result
Jason has 5 fewer bats than Nia. Carina has 2 times the number of bats as Nia. If Jason has 10 bats, how many fewer bats does Carina have than Jason?
def solve() -> int: nia_bats = 10 + 5 jason_bats = nia_bats - 5 carina_bats = nia_bats * 2 difference = carina_bats - jason_bats result = difference return result
If a rectangular plot of land has a length of 100 feet and a perimeter that is twice as large as a square plot of land, what is the length of one side of the square plot of land?
def solve() -> int: length_rectangular = 100 perimeter_square = 2 * (4 * length_rectangular) side_square = perimeter_square / 4 result = side_square return result
A triangular pyramid has a base with side lengths of 10cm, 8cm, and 6cm. Its height is 4cm. What is its volume?
def solve() -> int: base_side1 = 10 base_side2 = 8 base_side3 = 6 height = 4 base_area = (base_side1 + base_side2 + base_side3) / 2 volume = (1/3) * base_area * height result = volume return result
Rachel is a tutor who charges $50 per session. Last week, she had 5 sessions, but for every cancellation, she refunds $10. If Rachel refunded $20, how much did she earn last week?
def solve() -> int: sessions = 5 cancellations = 2 refund_amount = 20 session_cost = 50 refund_per_cancellation = 10 total_earnings = sessions * session_cost - cancellations * refund_per_cancellation - refund_amount result = total_earnings return result
Max starts cycling from Amsterdam to Brussels, which is 200 kilometers. Max cycles 40 kilometers the first day. The next day he cycles 9 kilometers more than one-half of what he cycled the first day. He cycles 50 kilometers the third day. How many kilometers further does Max have to cycle to be in Brussels?
def solve() -> int: total_distance = 200 day1_distance = 40 day2_distance = (day1_distance / 2) + 9 day3_distance = 50 total_cycled = day1_distance + day2_distance + day3_distance remaining_distance = total_distance - total_cycled result = remaining_distance return re...
Karen owes her friend $1000 for a loan she took 1 year ago. She paid $50 every month for the first 6 months. How much more does Karen need to repay her friend to clear the debt?
def solve() -> int: loan_amount = 1000 monthly_payment = 50 months_paid = 6 amount_paid = monthly_payment * months_paid remaining_debt = loan_amount - amount_paid result = remaining_debt return result
Maya and Ava have $12 in total. If Maya has three times the amount of money as Ava, how much money does Ava have?
def solve() -> int: maya_total = 12 maya_money = maya_total * 3 / 4 ava_money = maya_total - maya_money result = ava_money return result
Anna eats 3 slices and Ben eats 5 slices. What percentage of the pizza is left?
def solve() -> int: total_eaten = 3 + 5 slices_left = 12 - total_eaten percentage_left = (slices_left / 12) * 100 result = percentage_left return result
Student: Joan has 2 children and she needs to buy 3 pairs of shoes for each of them. If the shoes cost $40 for one pair, how much money will Joan need in total?
def solve() -> int: num_children = 2 num_shoes = 3 price_shoes = 40 total_cost = num_children * num_shoes * price_shoes result = total_cost return result
A train travels at a constant speed of 60 km/h and makes 8 stops along its route. Each stop takes 5 minutes. If the train leaves at 9:00 am, what time will it reach its final destination, which is 480 km away from the starting point?
def solve() -> int: speed = 60 stops = 8 stop_time = 5 distance = 480 departure = 9 * 60 travel_time = distance / speed total_time = travel_time + stop_time * stops arrival = departure + total_time hours = int(arrival // 60) minutes = int(arrival % 60) ...
Possible questions and programs are: Leila has 4 rabbits, each rabbit needs 0.5 cups of water and 1.5 cups of pellets every day. Leila also has a hamster that needs 0.25 cups of water and 0.75 cups of pellets every day. How many cups of water and pellets does Leila need for her pets every day?
def solve() -> int: rabbit_water = 0.5 rabbit_pellet = 1.5 hamster_water = 0.25 hamster_pellet = 0.75 total_water = 4 * rabbit_water + hamster_water total_pellet = 4 * rabbit_pellet + hamster_pellet result = (total_water, total_pellet) return result
A teacher gave two tests in a semester. Test 1 was worth 50 points and Test 2 was worth 100 points. If Mr. Johnson scored 80% on the first test and 90% on the second test, what is his final average score?
def solve() -> int: test1_weight = 0.50 test2_weight = 0.50 test1_score = 0.80 test2_score = 0.90 final_score = (test1_weight*test1_score) + (test2_weight*test2_score) result = round(final_score*100, 2) return result
If John ran 10 miles in 1 hour, how much time in minutes would it take him to run 25 miles at the same speed?
def solve() -> int: distance_1 = 10 time_1 = 1 distance_2 = 25 speed = distance_1 / time_1 time_2 = distance_2 / speed time_2_minutes = time_2 * 60 result = time_2_minutes return result
There are 50 students in a class. John scored 80 marks in mathematics and the average score of the class in mathematics is 75. If John's score is excluded, the class average in mathematics falls to 74. What is the average score of the class, excluding John's score?
def solve() -> int: num_students = 50 class_avg = 75 new_class_avg = 74 john_score = 80 class_total = num_students * class_avg new_class_total = (num_students - 1) * new_class_avg excluded_score_total = class_total - new_class_total - john_score num_remaining_students = num_students - 1 ...
Question A: Sara wants to buy some books. Book A costs $5, Book B costs $10, and Book C costs $15. If Sara wants to buy 2 copies of Book A, 1 copy of Book B, and 3 copies of Book C. How much money does Sara need?
def solve() -> int: cost_book_A = 5 cost_book_B = 10 cost_book_C = 15 num_copies_A = 2 num_copies_B = 1 num_copies_C = 3 total_cost_A = num_copies_A * cost_book_A total_cost_B = num_copies_B * cost_book_B total_cost_C = num_copies_C * cost_book_C total_cost = total...
A rectangular prism has a length of 8 inches, a width of 5 inches, and a height of 3 inches. What is the volume of the rectangular prism in cubic feet?
def solve() -> int: length = 8 / 12 width = 5 / 12 height = 3 / 12 volume = length * width * height result = volume return result
Student: Mia likes to draw. She drew for 2 hours on Monday and the same time on Tuesday. On Wednesday she joined an online art class, so she drew one hour more than on Tuesday. How many hours on average has Mia spent drawing during these three days?
def solve() -> int: monday = 2 tuesday = 2 wednesday = 3 total_hours = monday + tuesday + wednesday average_hours = total_hours / 3 result = average_hours return result
Ava saves $50 every month for 2 years. If she puts all her money into a savings account with a 5% annual interest rate, how much money will she have at the end of the 2 years?
def solve() -> int: months = 24 money = 50 * months interest = 1.05 ** (months / 12) money *= interest result = money return result
Lily has been babysitting for two more years than her cousin. If her cousin babysat for 3 years and earned $2500 per month, and Lily now earns 20% more than her cousin, what is the total amount earned by both cousins while babysitting?
def solve() -> int: cousin_years = 3 cousin_salary = 2500 lily_years = cousin_years + 2 lily_salary = cousin_salary * 1.2 cousin_earnings = cousin_years * cousin_salary lily_earnings = lily_years * lily_salary total_earnings = cousin_earnings + lily_earnings result = total_earnings r...
A runner is training for a race and has run a total of 48 miles. If each day they run 6 miles, how many days has the runner been training?
def solve() -> int: total_miles = 48 miles_per_day = 6 days_of_training = total_miles // miles_per_day result = days_of_training return result
Rachel runs a tutoring business. She charges $30 per hour and pays her tutors $15 per hour. Every month, she has to pay $5,000 in rent, 20% of her total profit in taxes, and $2,500 to her administrative assistant. If Rachel's tutors work a total of 500 hours in one month, how much is her total profit or loss?
def solve() -> int: tutor_rate = 15 rachel_rate = 30 rent = 5000 tax_rate = 0.2 admin_salary = 2500 total_tutor_hours = 500 tutor_cost = tutor_rate * total_tutor_hours rachel_earnings = rachel_rate * total_tutor_hours total_expenses = rent + tutor_cost + admin_salary taxes =...
A rectangular garden has a length of 10 meters and a width of 8 meters. What is the area of the garden? What is the perimeter of the garden?
def solve() -> int: result = 80, 36 return result
Tyler has 6 packs of 12 crayons. He uses 4 crayons per drawing and makes as many drawings as he can. Then he gives away 18 drawings to his classmates. How many crayons does he have left?
def solve() -> int: total = 6 * 12 per_drawing = 4 drawings = total // per_drawing used = drawings * per_drawing given = 18 * per_drawing left = total - used - given result = left return result
If you have 200 dollars and you spend 20% of your money, how much money will you have left?
def solve() -> int: amount_spent = 200 * 0.2 money_left = 200 - amount_spent result = money_left return result
Brandon has 16 hot wheels cars. His friend, Tyler has one-third of that amount and then trades 5 cars with Jake. How many hot wheels cars does Tyler have now?
def solve() -> int: brandon_cars = 16 tyler_cars = brandon_cars / 3 tyler_cars -= 5 result = tyler_cars return result
Mrs. Adams baked 150 cupcakes for a school event. She sold 3/4 of them at the event and gave the remaining cupcakes to her children to share equally. If she has 3 children, how many cupcakes will each child get?
def solve() -> int: cupcakes = 150 sold_cupcakes = cupcakes * 3 / 4 remaining_cupcakes = cupcakes - sold_cupcakes cupcakes_per_child = remaining_cupcakes // 3 result = cupcakes_per_child return result
Student: A car can go 25 miles per gallon of gas. If a road trip is 300 miles, how many gallons of gas are needed for the trip?
def solve() -> int: miles = 300 miles_per_gallon = 25 gallons_needed = miles / miles_per_gallon result = gallons_needed return result
Student: A flower shop sells 50 daisies and 25 roses per day. If they receive a shipment of 100 lilies, how many days will it take to sell all the flowers?
def solve() -> int: daisies = 50 roses = 25 lilies = 100 total_flowers = daisies + roses + lilies days = total_flowers // (daisies + roses) remaining_flowers = total_flowers % (daisies + roses) remaining_days = remaining_flowers // lilies total_days = days + remaining_days result = t...
Result = 60 There are 15 pens on a table. If 2 pens are removed, how many pens are left on the table?
def solve() -> int: initial_pens = 15 pens_removed = 2 remaining_pens = initial_pens - pens_removed result = remaining_pens return result
James' phone broke and he used $40 from his savings account to pay for the repair. Before the repair, he bought a new screen that cost twice as much as the repair fee and a phone case that was half the price ofA musician earned 4% of the total sales of their CD and 8% of the total sales of their vinyl record. If 20,000...
def solve() -> int: repair_fee = 40 screen_cost = repair_fee * 2 phone_case_cost = repair_fee / 2 cd_price = 10 cd_quantity = 20000 vinyl_price = 25 vinyl_quantity = 5000 cd_sales = cd_price * cd_quantity vinyl_sales = vinyl_price * vinyl_quantity cd_earnings = cd_...
A music class has 23 students. Each student has a guitar and a violin. If 32 instruments get damaged in a day, how many are left?
def solve() -> int: students = 23 instruments = students * 2 damaged_instruments = 32 instruments_left = instruments - damaged_instruments result = instruments_left return result
Adam needs to mix sand and cement in a ratio of 3:5 to make concrete. If he uses a total of 60 pounds of material, what is 1/5 of the difference between the amount of sand and cement used?
def solve() -> int: sand_ratio = 3 cement_ratio = 5 total_ratio = sand_ratio + cement_ratio total_material = 60 sand_amount = (sand_ratio/total_ratio) * total_material cement_amount = (cement_ratio/total_ratio) * total_material difference = sand_amount - cement_amount one_fifth...
``` Henry is driving to a city which is 250 miles away. On Monday, he drives 50 miles. On Tuesday, he drives twice as many miles as he drove on Monday. On Wednesday, he drives 60 miles. On Thursday, he drives 40 miles less than he drove on Tuesday. On Friday, he drives the remaining distance. How many miles does he sti...
def solve() -> int: miles_driven = 50 + (2*50) + 60 + (2*50-40) miles_left = 250 - miles_driven result = miles_left return result
During the summer, Kevin rode his bike three times. The first time he rode it for 10 miles, the second time for 7 miles, and the third time for 12 miles. What is the total distance that Kevin rode his bike?
def solve() -> int: distance_1 = 10 distance_2 = 7 distance_3 = 12 total_distance = distance_1 + distance_2 + distance_3 result = total_distance return result
The average weight of 8 students in a class is 60 kg. If a new student with a weight of 80 kg joins, what is the new average weight of the class?
def solve() -> int: total_weight = 8*60 + 80 new_average = total_weight / 9 result = new_average return result
Sophia acquires 30 jars of peanut butter for $8 each and sells them for $12 per jar. If each jar weighs 2 pounds, how much profit did she make?
def solve() -> int: jars_acquired = 30 cost_per_jar = 8 selling_price_per_jar = 12 weight_per_jar = 2 total_cost = jars_acquired * cost_per_jar total_revenue = jars_acquired * selling_price_per_jar total_weight = jars_acquired * weight_per_jar profit = total_revenue - total_cos...
It takes Sarah 4 hours to complete a painting. If she paints for 6 hours, how many paintings can she complete?
def solve() -> int: hours = 6 time_per_painting = 4 num_paintings = hours // time_per_painting result = num_paintings return result
Student: If a number is increased by 20%, and then the resultant is reduced by 18%, what is the net effect on the original number?
def solve() -> int: x = 100 y = x * 1.2 z = y * 0.82 effect = (z - x) / x * 100 result = effect return result
A school wants to buy 25 books, each of which costs $20. The school earns $300 per day by letting their playground for rent. If 50% of the earnings are spent on buying the books, how many days will the school have to rent their playground to afford the books?
def solve() -> int: total_cost = 25*20 total_earnings = 300 allowed_cost = 0.5*total_earnings days = total_cost//allowed_cost result = days return result
Ms. Brown has a startup company with 5 employees. Her company makes a revenue of $250,000 per month, and 12% of it goes to taxes. After spending 3% of the remaining amount on marketing expenses and 13% of what's left on operational costs, she has enough money to pay her employees and have $50,000 left over. What is the...
def solve() -> int: revenue = 250000 taxes = revenue * 0.12 net_income = revenue - taxes marketing_expenses = net_income * 0.03 operational_costs = net_income * 0.13 remaining_money = net_income - marketing_expenses - operational_costs employee_pay = (remaining_money - 50000) / 5 result ...
Ben decided to sell his old books since he had already read them all. He sold his novels for $5 each, his textbooks for $10 each, and his magazines for $2 each. He also sold his comics at 20% off its original price of $3. Lastly, he sold his encyclopedias for $50. How much money did Ben make?
def solve() -> int: novels = 15 textbooks = 10 magazines = 20 comics = 5 encyclopedias = 50 total_novels = novels * 5 total_textbooks = textbooks * 10 total_magazines = magazines * 2 total_comics = comics * 0.8 * 3 total_encyclopedias = encyclopedias total_money = t...
A grocery store has 60 apples in stock. In the morning, 23 apples were sold and 6 more were sold in the afternoon. If the store sold twice as many apples in the afternoon compared to the morning, how many apples were left unsold?
def solve() -> int: morning_apples_sold = 23 afternoon_apples_sold = 6 total_apples_in_stock = 60 afternoon_apples_sold = 2 * morning_apples_sold total_apples_sold = morning_apples_sold + afternoon_apples_sold apples_left = total_apples_in_stock - total_apples_sold result = apples_...
Jake has a rectangular garden with a length of 10 feet and a width of 4 feet. He wants to know how much fencing he will need to purchase to cover all 4 sides of the garden. How many feet of fence will Jake need to purchase?
def solve() -> int: length = 10 width = 4 perimeter = (2*length)+(2*width) result = perimeter return result
Q5: John bought a home for $200000. He was able to pay a 20% down payment. How much money did John put down?
def solve() -> int: total_cost = 200000 down_payment_percentage = 0.2 down_payment = total_cost * down_payment_percentage result = down_payment return result
Sarah and Lisa shared a sum of $9,600. If Sarah's share is 25% of the money, how much did Lisa receive?
def solve() -> int: total_money = 9600 sarah_share = total_money * 0.25 lisa_share = total_money - sarah_share result = lisa_share return result
Student: A train travels a distance of 420 km at a speed of 70 km/hr. How long will it take the train to complete the journey?
def solve() -> int: distance = 420 speed = 70 time = distance / speed result = time return result
A painter needs 4 cans of paint to paint a single room. There are 10 rooms in a building. How many cans of paint does the painter need in total?
def solve() -> int: paint_per_room = 4 num_rooms = 10 total_paint_cans = paint_per_room * num_rooms result = total_paint_cans return result
Daniela and Kai are making bracelets and necklaces for a charity event. They use beads of different colors and sizes. Each bracelet uses 12 beads and each necklace uses 25 beads. They have 500 small blue beads, 400 large red beads and 300 medium yellow beads. They sell the bracelets for $3.00 each and the necklaces for...
def solve() -> int: total_beads = 500 + 400 + 300 max_bracelets = total_beads // 12 max_necklaces = total_beads // 25 num_products = min(max_bracelets, max_necklaces) num_bracelets = num_products // 2 num_necklaces = num_products // 2 + num_products % 2 bracelets_revenue = num_bracelets * ...
Tyler has been practicing yoga for the past year. In the first half of the year, he practiced 4 times per week. In the second half of the year, he increased his practice to 5 times per week. How many times total did he practice for the year?
def solve() -> int: first_half = 4 * 26 second_half = 5 * 26 total_practice = first_half + second_half result = total_practice return result
Student: Dave has a collection of 9 baseball cards. He plans to trade 3 of them with his friends. How many cards will he have left in his collection?
def solve() -> int: cards_in_collection = 9 cards_to_trade = 3 cards_left = cards_in_collection - cards_to_trade result = cards_left return result
An athlete runs the first 800 meters of a race in 2 minutes. If he maintains the same pace for the remainder of the 5km race, how long will it take him to run the entire race?
def solve() -> int: first_distance = 800 first_time = 2 second_distance = 5000 - first_distance speed = first_distance/first_time time = second_distance/speed total_time = first_time + time result = total_time return result
Student: Clara spent 15% of her monthly income on transportation, a third of her income on rent, and saved the remaining amount. If she spent $180 on transportation, how much does she deposit to her savings account each month?
def solve() -> int: transportation = 180 transportation_rate = 0.15 rent_rate = 1/3 income = transportation / transportation_rate rent = income * rent_rate savings = income - transportation - rent result = savings return result
A rectangle has a length of 15 cm and a width of 10 cm. If a square has the same perimeter as the rectangle, what is the length of one side of the square?
def solve() -> int: length = 15 width = 10 rectangle_perimeter = 2*length + 2*width square_perimeter = rectangle_perimeter length_of_one_side = square_perimeter/4 result = length_of_one_side return result
Student: Karen wants to make 96 cookies. If the recipe requires 0.5 cup of butter for each dozen cookies, how many cups of butter will Karen need?
def solve() -> int: cookies = 96 butter_per_dozen = 0.5 dozens = cookies // 12 butter = butter_per_dozen * dozens result = butter return result
Alice walks 2 km every morning and 3 km every evening on weekdays, and 5 km every morning and 4 km every evening on weekends. How far does she walk in a week?
def solve() -> int: morning_weekday = 2 evening_weekday = 3 morning_weekend = 5 evening_weekend = 4 weekdays = 5 weekends = 2 distance_weekday = (morning_weekday + evening_weekday) * weekdays distance_weekend = (morning_weekend + evening_weekend) * weekends distance_w...
A bakery orders 500 kg of flour for the week. On Monday, 100kg of flour are used to bake bread. On Tuesday, 50kg of flour is stored in an area with a pest infestation and becomes unusable. On Wednesday, a new shipment arrives, twice the size of the first one. How much flour does the bakery have available on Thursday?
def solve() -> int: flour_ordered = 500 flour_used_monday = 100 flour_infested_tuesday = 50 flour_arrived_wednesday = flour_ordered * 2 flour_available_thursday = flour_ordered - flour_used_monday - flour_infested_tuesday + flour_arrived_wednesday result = flour_available_thursday ...
A bike costs $300 and is on sale for 20% off. What is the new cost of the bike?
def solve() -> int: initial_cost = 300 discount = 0.2 new_cost = initial_cost * (1 - discount) result = new_cost return result
A school has 1800 students and 36 classrooms. The students are divided equally into the classrooms. The principal decided to reduce the number of classrooms by 9 and redistribute the students. How many students were in each classroom after the redistribution?
def solve() -> int: students_per_class = 1800 / 36 classrooms_left = 36 - 9 students_per_class_new = 1800 / classrooms_left result = students_per_class_new return result
Alice buys a book for $12 and a magazine for $4. She uses a coupon that gives her 25% off one item. She also pays $2 for shipping. How much did she spend?
def solve() -> int: book_price = 12 coupon_rate = 0.25 book_final = book_price * (1 - coupon_rate) magazine_price = 4 total_before_shipping = book_final + magazine_price shipping_cost = 2 total_after_shipping = total_before_shipping + shipping_cost result = total_after_shipping ...
Daniel has 5 camels and six times more monkeys. He can sell each camel for $500 and each monkey for $100. If he sells all his animals, how much money would he earn?
def solve() -> int: number_of_camels = 5 price_of_camels = 500 number_of_monkeys = number_of_camels * 6 price_of_monkeys = 100 total = (number_of_camels * price_of_camels) + (number_of_monkeys * price_of_monkeys) result = total return result
Emily is counting the number of books on a shelf. 40% of the books are fiction, 30% are non-fiction and the rest are poetry. If there are 20 poetry books, how many non-fiction books are there?
def solve() -> int: fiction_percentage = 40 non_fiction_percentage = 30 poetry_books = 20 total_books = 100 fiction_books = (fiction_percentage / 100) * total_books non_fiction_books = (non_fiction_percentage / 100) * total_books poetry_percentage = 100 - fiction_percentage - non_f...
There are 4 lecture halls in a school, each with the same capacity of 300 people. What is the total capacity of the 4 halls?
def solve() -> int: num_halls = 4 hall_capacity = 300 result = num_halls * hall_capacity return result
A family is planning a dinner party and wants to make sure there is enough food for everyone. They decide to make equal amounts of pasta, chicken, and salad. If they want every other dish to be chicken, and they need to feed 12 people, how much should they make of each dish?
def solve() -> int: people = 12 pasta = people // 3 chicken = people // 3 salad = people // 3 result = f'<<<{pasta}, {chicken}, {salad}>>>' return result
In a class of 30 students, the ratio of boys to girls is 2:3. How many girls are in the class?
def solve() -> int: total_students = 30 boy_to_girl_ratio = 2/3 num_girls = total_students / (1 + boy_to_girl_ratio) result = num_girls return result
A school has 450 students. If 35% of them are girls, how many boys does the school have?
def solve() -> int: total_students = 450 girls_percentage = 0.35 girls_count = total_students * girls_percentage boys_count = total_students - girls_count result = boys_count return result
Clara and Arianne ran in a race. Clara ran twice as many kilometers as Arianne did. Arianne ran 4 kilometers. How many kilometers in total did Clara and Arianne run?
def solve() -> int: arianne_distance = 4 clara_distance = arianne_distance * 2 total_distance = arianne_distance + clara_distance result = total_distance return result
A restaurant bill includes a 10% service charge on the total bill before tax. If the total bill after tax is $110, and the tax rate is 6%, what was the original bill amount before tax and service charge?
def solve() -> int: total_bill = 110 tax_rate = 0.06 service_charge = 0.1 bill_before_service_charge = total_bill / (1 + tax_rate) bill_before_tax = bill_before_service_charge / (1 + service_charge) result = bill_before_tax return result
Student: Mary has 6 boxes of books, each box can hold 25 books. If she wants to know how many books she has in total, how many books does Mary have in total?
def solve() -> int: num_boxes = 6 num_books_per_box = 25 total_num_books = num_boxes * num_books_per_box result = total_num_books return result
A company is making $1200 profit per month. If they want to make $800 more profit, how much would they need to make now?
def solve() -> int: new_profit = 1200 + 800 result = new_profit return result
Sarah spends 50 minutes a day writing in her journal. How many hours does she spend writing per week?
def solve() -> int: minutes_per_day = 50 minutes_per_hour = 60 days_per_week = 7 hours_per_week = (minutes_per_day * days_per_week) / minutes_per_hour result = hours_per_week return result
A bundle of 6 bath towels costs $20. The cost of one individual towel is $5. How much can you save, in dollars, per towel if you buy the bundle versus individual towels?
def solve() -> int: bundle_size = 6 bundle_cost = 20 towel_cost = bundle_cost / bundle_size savings_per_towel = towel_cost - 5 result = savings_per_towel return result
Ethan works at a grocery store and stocks an average of 75 items every day. On Sundays, his number of items stocked is about 50% higher than the daily average. How many items does he stock in a week, assuming the store is open from Monday to Sunday?
def solve() -> int: daily_average = 75 sunday_stock = daily_average * 1.5 weekly_stock = daily_average * 6 + sunday_stock result = weekly_stock return result
Student: Jack buys 4 cups of water for $16, 6 ice creams for $98, and 8 cookies for $64. What percent of the cost is the water and ice creams?
def solve() -> int: water_quantity = 4 water_cost = 16 ice_cream_quantity = 6 ice_cream_cost = 98 cookie_quantity = 8 cookie_cost = 64 water_ice_cream_cost = water_cost + ice_cream_cost total_cost = water_cost + ice_cream_cost + cookie_cost percentage = water_ice_cream_cost / total_c...
Student: Ryan bakes 3 cakes with 16 strawberries in each cake and 5 cakes with 20 strawberries in each cake. How many strawberries does Ryan make?
def solve() -> int: num_cakes_16 = 3 num_cakes_20 = 5 strawberries_16 = 16 strawberries_20 = 20 total_strawberries_16 = num_cakes_16 * strawberries_16 total_strawberries_20 = num_cakes_20 * strawberries_20 result = total_strawberries_16 + total_strawberries_20 return result
Student: Q6: Ben is replacing the carpet in his living room. He needs 42 yards of carpet and each yard costs $19. What will the cost of the carpet be?
def solve() -> int: yards = 42 cost_per_yard = 19 cost = yards * cost_per_yard result = cost return result
If a school has 400 students and they are evenly divided into 20 classrooms, how many students are in each classroom?
def solve() -> int: total_students = 400 total_classrooms = 20 students_per_classroom = total_students / total_classrooms result = students_per_classroom return result
Student: Anna is making oatmeal cookies. She first mixes 4 cups of flour and 2 cups of oats together and then adds 2 tablespoons of baking soda. How many tablespoons of baking soda are in each bowl of cookie mixture?
def solve() -> int: flour = 4 oats = 2 baking_soda = 2 total_ingredients = flour + oats tablespoons_per_bowl = baking_soda / total_ingredients result = tablespoons_per_bowl return result
Jacob sleeps 4 hours a night from Monday to Wednesday. On Thursday and Friday, he sleeps for a total of 12 hours. He also takes a 1.5-hour nap on Saturday. How much sleep does he get in 2 weeks?
def solve() -> int: mon_to_wed = 4 * 3 thu_and_fri = 12 sat = 1.5 total_sleep = (mon_to_wed + thu_and_fri + sat) * 2 result = total_sleep return result
A group of friends played at an arcade and each person spent $5 on games. If there were 8 people in the group, how much money did they spend in total?
def solve() -> int: num_people = 8 cost_per_person = 5 total_cost = num_people * cost_per_person result = total_cost return result
On Tuesday, the Superstore sold 130 kg of rice. On Wednesday they sold 30% more than on Tuesday. On Thursday they sold 200 kg, which was 30% less than on Wednesday. How many kgs of rice did the Superstore sell in total?
def solve() -> int: rice_tuesday = 130 discount = 0.3 rice_wednesday = rice_tuesday * (1+discount) rice_thursday = rice_wednesday * (1-discount) total_rice = rice_tuesday + rice_wednesday + rice_thursday result = total_rice return result
Sofia is driving to her friend's house which is 65 miles away. She drives at an average speed of 55mph. How long will it take her to get there?
def solve() -> int: distance = 65 speed = 55 time = distance / speed result = time return result
Mr. and Mrs. Smith are making a cake which requires 2 cups of sugar. Their neighbour, Mrs. Jones, is also making a cake and needs 4 more cups of sugar. How many cups of sugar do they need altogether?
def solve() -> int: sugar_for_smiths = 2 sugar_for_jones = sugar_for_smiths + 4 total_sugar = sugar_for_smiths + sugar_for_jones result = total_sugar return result
A group of people went to a restaurant and split a bill of $125. If there were 8 people in the group and everyone ordered the same number of items, how much did each item cost?
def solve() -> int: total_bill = 125 num_people = 8 cost_per_item = total_bill / num_people result = cost_per_item return result
Lisa solved twice as many math problems in October as she did in September. In November, Lisa solved one-fourth of what she solved in October. If Lisa solved 1200 math problems in November, how many problems did she solve from September to November?
def solve() -> int: september_problems = 0 october_problems = september_problems * 2 november_problems = october_problems / 4 november_problems = 1200 total_problems = september_problems + october_problems + november_problems result = total_problems - september_problems return result
Ethan, Sophia, and Jacob each baked cakes for a bake sale. Ethan baked 15 cakes, Sophia baked 12 cakes less than Ethan, and Jacob baked half of the total number of cakes that Ethan and Sophia baked. If they sold the cakes for $8 each and then divided their earnings equally, how much money does each person make?
def solve() -> int: ethan_cakes = 15 sophia_cakes = ethan_cakes - 12 total_cakes = ethan_cakes + sophia_cakes jacob_cakes = total_cakes / 2 total_earnings = total_cakes * 8 each_person_earnings = total_earnings / 3 result = each_person_earnings return result
Student: A school is holding a fundraiser by selling cookies. Each of the 25 classes is given 8 boxes of cookies to sell. The first class sells 3 boxes and splits the money equally among the 20 students. The second class sells 5 boxes and gives $2 to each of the 15 students and the rest to the teacher. The last class s...
def solve() -> int: boxes_per_class = 8 classes = 25 box_cost = 12 first_class_students = 20 second_class_students = 15 last_class_students = 18 last_class_teacher_ratio = 3 last_class_president_ratio = 2 last_class_students_ratio = 1 total_money = boxes_per_class * clas...
At the farm, there were 5 cows, 12 chickens, and 8 goats. How many eggs were there in total?
def solve() -> int: cows = 5 chickens = 12 goats = 8 eggs_per_chicken = 1 eggs_per_cow = 0 eggs_per_goat = 0 total_eggs = (chickens * eggs_per_chicken) + (cows * eggs_per_cow) + (goats * eggs_per_goat) result = total_eggs return result
A box of tomatoes weigh 15 kg less than a basket of tomatoes containing 5 boxes of tomatoes. Each box of tomatoes weigh 3 kg. What is the weight of the basket of tomatoes?
def solve() -> int: box_weight = 3 boxes = 5 box_total_weight = boxes*box_weight basket_weight = box_total_weight + 15 result = basket_weight return result
The ratio of boys to girls in a class is 2:3. If there are 24 students in the class, how many boys are there?
def solve() -> int: total_students = 24 boy_ratio = 2 / (2 + 3) boys = total_students * boy_ratio result = boys return result
A recipe for 12 cupcakes calls for 2 cups of flour. How much flour is needed to make 36 cupcakes?
def solve() -> int: number_of_cupcakes = 36 flour_per_cupcake = 2/12 total_flour = number_of_cupcakes * flour_per_cupcake result = total_flour return result
A 10 oz bag of coffee beans normally costs $8, but it is now on sale for $6. A can of whipped cream is being sold at a discount of $1. How much will you save if you buy 2 bags of coffee beans and 4 cans of whipped cream?
def solve() -> int: bag_price = 8 sale_price = 6 whipped_cream_discount = 1 bags = 2 cans = 4 total_cost_before_discount = (bag_price * bags) + (whipped_cream_discount * cans) total_cost_after_discount = (sale_price * bags) + ((whipped_cream_discount - 1) * cans) total_sav...